Commit Graph

4065 Commits

Author SHA1 Message Date
Frederik Gladhorn
6213b81457 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
	src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
	tools/configure/configureapp.cpp

Change-Id: I3092bd3276af14304b7ab3ae1e1cc05d11cdede0
2013-06-20 16:45:12 +02:00
Frederik Gladhorn
533820320c Merge remote-tracking branch 'origin/release' into stable
Change-Id: I94bb158562ae6b80a87b40139d7302ea7b9b9aa8
2013-06-20 16:13:38 +02:00
Stephen Kelly
249c5f0689 If a QWidget is ignored for auto-quit, ignore its corresponding QWindow.
Unit test by Friedemann Kleint <Friedemann.Kleint@digia.com>

Task-number: QTBUG-31569
Change-Id: I526d33d4f88a41f6ac349098476bc45af6c841b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-06-19 12:16:03 +02:00
Konstantin Ritt
e3dadce470 Ensure we don't repeat QTBUG-30931 in Qt5
The issue is already fixed in 5.0 but let's be nice and ensure the issue
won't be reintroduced later.

Task-number: QTBUG-30931

Change-Id: Ia6944acaf6e7217f8d0f1fa75d0e9977db11d892
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-18 13:36:23 +02:00
Rafael Roquetto
1d23172c99 BlackBerry: fix tst_qlistview
Because fonts are bigger on BlackBerry than those assumed when the test was
written, explicitly adjust the font size on this platform.

Change-Id: I6a23c28c2d32edf744dd5de09ea0a97fd5f9b6d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-06-18 06:25:52 +02:00
Rafael Roquetto
27107b43a3 Fix tst_qlistview for full screen platforms
Some test cases rely on the fact that show() is not fullscreen, which may not
be true for some platforms. Explicitly make use of showNormal() to avoid
full-screen show on these platforms.

Change-Id: Ie62fe21bf0f466c561a27cffda99d0201b4a45af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
2013-06-18 06:25:52 +02:00
Rafael Roquetto
ed0b5e125b Fix tst_QWindow for fullscreen platform plugins
Some tests assume that QWindow::show() behaves like
QWindow::showNormal(), which is not true for platforms in which the show is
fullscreen, forcing QWindow::showNormal() to be explicitly called.

Change-Id: Ib5f23a4d01bc6a3a2973f57488996c8c198c45f3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-06-18 06:25:52 +02:00
Mitch Curtis
8a680201f1 Fix roundtrip conversion of datetimes.
QDateTime.toString() is writing out milliseconds since change
15da0a5af2. Unfortunately this breaks
QDateTime::fromString() with Qt::TextDate which can't handle the new
format.

Fix by making QDateTime::fromString split up seconds and milliseconds
on a period, if any. Now
QDateTime dt = ...;
assert(QDateTime::fromString(dt.toString(), Qt::TextDate) == dt)
works again.

Change-Id: Ibfe9032e357ceaf894e33f3e33affe94f56dbf5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-17 13:21:49 +02:00
Frederik Gladhorn
e5bcf68d30 Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-06-15 22:39:25 +02:00
Shawn Rutledge
3e2cd8ef6f fix QFileSystemEngine::createDirectory race condition
During a call to QDir::mkpath(), the same path could be created
by another process, in which case the OS mkdir will fail with EEXIST.
But the docs for mkpath() state that it's not an error if it
already exists, whereas for mkdir() it is an error.  So
QFileSystemEngine::createDirectory should accept the EEXIST error
silently if it occurs while creating the sequence of parent directories
and the final leaf directory, but should fail if EEXIST happens when
it was called from QDir::mkdir(), which is when the createParents
parameter is false.  We assume the operating system mkdir() and
CreateDirectory() are atomic, so there should be no race condition
in QDir::mkdir().  It's not necessary for mkpath() to call stat()
at each level, only to check whether an existing entry is a directory
or a file.  Also added to the autotest to verify that if the
path is an existing file, creating a dir with the same name will
fail in either mkdir or mkpath.

Task-number: QTBUG-30046
Change-Id: I926352f10654fdf3b322c8685bb85ad8b8844874
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-06-14 16:57:57 +02:00
Jędrzej Nowacki
d57d184b6d Add basic conversion functions from QVariant(QJsonValue).
There is a mismatch how QML and C++ converts QJsonValue. This patch
unifies conversions by adding QJsonValue support in QVariant::convert().

Change-Id: I8a1db3d77c517945ef48064b4b66ba03aa4f2fd0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-06-14 15:50:49 +02:00
Friedemann Kleint
af2deb85ca Add object names to QGLWidget-reparenting test.
Task-number: QTBUG-31762

Change-Id: I213b4f17aa04cc99df7183df547a52c2c2a68626
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-06-14 15:13:26 +02:00
David Faure
d226e0567c Manual test: fix compilation with namespaced Qt
Change-Id: I098bf2ec123e1b49fd04df5cea6fb7d5b1b62cfb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-06-14 11:26:21 +02:00
Frederik Gladhorn
e2776b44a0 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoamenubar.mm

Change-Id: I4a699fc8a7f30b2af9de8e496c3d5f027b7495bb
2013-06-12 19:17:07 +02:00
Frederik Gladhorn
be4b80af82 Merge remote-tracking branch 'origin/release' into stable
Change-Id: If29ca1b27da4592d40a7678837c359f75dac1209
2013-06-12 14:43:55 +02:00
Friedemann Kleint
443253cf11 Let QTemporaryDir::stressTest() run in temporary directory.
Task-number: QTBUG-31618

Change-Id: I60aaa4f57710816cd0e22ea9b097c7e85466fd0c
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-06-12 14:12:05 +02:00
Friedemann Kleint
0d459619a9 QDockWidget: Keep position when undocking.
Initialize undockedGeometry to roughly the current position.

Task-number: QTBUG-31044
Change-Id: I03cbe280d1215bb58ab721b60e29b45359cde76d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-06-12 12:42:51 +02:00
Oswald Buddenhagen
69fa0012c7 use qtconcurrent instead of qtgui in test code
this works with -no-gui, and doesn't interfere with our upcoming ANGLE
hackery.

Change-Id: I2985cc0acd1fbf185b8967ffe58606b1b7dd9d1e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-06-10 21:12:01 +02:00
Frederik Gladhorn
75067b56fa Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-06-10 19:54:53 +02:00
Rafael Roquetto
e554ab4585 BlackBerry: fix tst_QLocale::emptyCtor()
BlackBerry OS does not allow for explicitly controlling the locale through the
"LANG" environment variable. Locale is controlled by the underlying PPS
Service instead.

Change-Id: I22154e39f81a9467ad7fdb90a042396390398b1b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
2013-06-10 16:32:57 +02:00
Frederik Gladhorn
0eff16611f Merge remote-tracking branch 'origin/release' into stable
Change-Id: I89c251999ae2a82522b40471fd13f2e06b00ece8
2013-06-10 10:00:34 +02:00
Thiago Macieira
ebea15cb33 QEventLoop: Remove the test that checked throwing from an event handler
In Qt 5, we declared that throwing from event handlers is undefined
behavior. So stop testing this.

We will try our best to capture and pass along std::bad_alloc, but even
that might not work, depending on compiler settings. In particular,
after the upgrade to MinGW/GCC 4.8 with DW2, this test stopped working.

Task-number: QTBUG-31615
Change-Id: Ibf5fb2ce0c48b983549096bf7aac434b6ed3ac2e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-08 23:00:50 +02:00
Thiago Macieira
9095210c0b tst_QUrl: check that prohibited characters in hostnames are not valid
qt_nameprep is tested by tst_qurlinternal. We just need to be sure that
QUrl handles them correctly.

Change-Id: Ic563004870d2cf2fa7a31ce49fff7280d5ffb5f3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-06-08 15:20:44 +02:00
Friedemann Kleint
9e65808acf tst_qfilesystemmodel: Fix warnings about comparing int/bool.
warning C4804: '<=' : unsafe use of type 'bool' in operation

Remove outer loop and replace ugly ROW_NAME macro by
inline function.

Change-Id: Id7e4ef047adaf8017b8c21621d19c151993cc6dd
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-08 10:29:34 +02:00
Friedemann Kleint
a730b5fabf tst_qmessageauthenticationcode: Fix warning about character conversion.
warning C4309: 'argument' : truncation of constant value.

Change-Id: I54e9b515d065c1a89bf790fb214c335e852ce5ac
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-08 10:29:34 +02:00
Friedemann Kleint
2b401796c7 tst_qguivariant: Fix warnings about double / float conversion.
warning C4305: 'argument' : truncation from 'double ' to 'float'

Change-Id: If9bf2f79592d305e767d2a8c38e577c5dff51129
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-08 10:29:34 +02:00
Friedemann Kleint
9e069d95f4 tst_qdom: Fix warning about character conversion,
warning C4309: 'argument' : truncation of constant value.

Change-Id: I04262dcb71b916abeab27e7b8bc2ca6c875794d2
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-08 10:29:34 +02:00
Friedemann Kleint
3e56b01895 tst_qglthreads: Fix warnings about unused variables.
Change-Id: I6bc95e8335474753d6506db5e8119710797f4f1b
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-08 10:29:34 +02:00
Friedemann Kleint
876202ddf2 tst_qjson: Fix MSVC C4293 warning about shift operation.
warning C4293: '<<' : shift count negative or too big,
undefined behavior.

Change-Id: I858dd08f16ea0e00f2384491fc735b7367c6925d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-08 10:29:34 +02:00
Thiago Macieira
4d93393a6d QUrl stringprep: fix handling of U+0080: it's prohibited
Edge case: a > that should have been >=. Without it, we never ran the
rest of the IDN nameprepping.

Change-Id: I2276d660de3a70d0c561bb18816820d9a0f47e77
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-06-08 05:06:57 +02:00
Thiago Macieira
736a052d93 QUrl stringprep: fix handling of prohibited characters
RFC 3454 says about prohibited characters (section 2, "Preparation
Overview"):

   3) Prohibit -- Check for any characters that are not allowed in the
      output.  If any are found, return an error.  This is described in
      section 5.

In other words, we mustn't simply strip the output of prohibited
characters. We must generate an error if they are present. We do that by
clearing the data.

We already had tests for prohibited output, but they were
indistinguishable from being stripped. So instead add some extra
characters so that we can tell whether the label was cleared.

Change-Id: I2d95217c27be5e2d54deed0036cb009e3b7f4886
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-06-08 05:06:47 +02:00
Rafael Roquetto
d4dba8a5c4 Unix: fix tst_QFile when run as root
Because tests are usually run as root on some setups, it does not
make sense to test for the right permissions of a readonly file.

Change-Id: I484f88722d3a9ce7123edc0fb57acae528fa194e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-07 22:18:42 +02:00
Rafael Roquetto
528fd2149e Use QFINDTESTDATA on tst_QStyle instead of SRCDIR
Update the test code to match the current Qt idiom for finding test data (and
fix it on QNX).

Change-Id: I63e7c97b717722e4e6859a12f329d56b26584ce6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-06-07 22:18:33 +02:00
Sergio Ahumada
9ef24ff8ed test: Mark tst_qopengl as insignificant on Win7 + Angle
This only marks tst_qopengl as insignificant on Windows 7 32bit
with the Angle configuration.

Task-number: QTBUG-31611
Change-Id: I1876b6fdc32fef93edf34c2bd61d03cc9ba11135
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2013-06-07 18:07:26 +02:00
Simon Hausmann
d8a6a67579 Add internal functions to QObjectPrivate for signal & slot connections in QML
In QML it is common to connect signals to slots that are implemented as
JavaScript functions. QML used to maintain separate data structures that
mirrored the QObject connection list and kept references to the JavaScript
objects necessary to perform the call on signal activation.

The recent addition of functor based QObject::connect makes it possible
to store this information in QSlotObjectBase sub-class instead, which
eliminates any extra bookkeeping.

This patch adds internal connect and disconnect overloads to QObjectPrivate
that allow for connecting QObject *sender, int signalIndex to a given
QSlotObjectBase and similar for disconnect.

Change-Id: I90f43d13eb95bd884d752484cf4faacc446f4d6a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-06-07 16:19:05 +02:00
Frederik Gladhorn
cd756e5ed5 Cocoa Accessibility: fix ignoring of objects
On Mac it's expected that some elements are
filtered out of the a11y hierarchy.
We do this with the shouldBeIgnored function.
The problem is that we would ignore some objects
and then return them in the child attribute function.
This is inconsistent and leads to voice over not working.

For example having a plain QWidget with other widgets as
children would cut off all of these widgets, since the
plain QWidget would be ignored.

Change-Id: I5f6c26b272e5ca57d59c1ed1ef47e9a2b1181295
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-06-07 14:54:39 +02:00
Friedemann Kleint
a1c8c581ce tst_qnetworkproxyfactory: Fix warnings about unused variables.
Change-Id: I6fa08353ebea5cdd7fc7a0c982bf1b9d34bbc077
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-06-07 14:54:33 +02:00
Thiago Macieira
24c52bd44b Update the DNS and name-resolver tests to the official zone
Change-Id: I02feb8029461383f38bcbdca138789b119a58b5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-07 05:31:31 +02:00
Bernd Weimer
70be62e95b QNX: fixed compilation of auto test
Compilation failed because "open" is defined as "open64" in fcntl.h.
This definition is reverted now.

Change-Id: I9badcf11131320c53e442cd5b8b21bb5aa4efee5
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2013-06-06 13:48:06 +02:00
Friedemann Kleint
1df0f4b2af Fix tst_qcombobox::itemListPosition.
Add font combo to top level via layout and position top level
instead of the (child) font combo.

Change-Id: I0f754c37c009d1ed83615b800d6f2467e858c047
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-05 15:42:01 +02:00
Mitch Curtis
4f2c96eaa8 Iterate over the smaller set in QSet::intersect().
When calling intersect() on a large (1000000 items) QSet, with a small
(1000 items) QSet as the argument, the function takes signifcantly
longer than when the operand and the argument are reversed. This is
because the operand set is always iterated over in its entirety.

This patch changes intersect() to iterate over the smaller set. This
reduces the large operand scenario's benchmark to ~0.000063
milliseconds, compared to the current ~134 milliseconds:

1000000.intersect(1000) = empty: 0.000063 (was 134)
1000.intersect(1000000) = empty: 0.000039 (was 0.000036)
1000000.intersect(1000) = 500: 0.10 vs (was 130)
1000.intersect(1000000) = 500: 0.023 vs (was 0.093)
1000000.intersect(1000) = 1000: 0.20 vs (was 139)
1000.intersect(1000000) = 1000: 0.017 vs (was 0.016)

Task-number: QTBUG-22026

Change-Id: I54b25c49c78c458fef355e9c6222da8a64c7681f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-05 09:35:42 +02:00
Frederik Gladhorn
80604a0786 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h
	src/plugins/platforms/cocoa/qnsview.mm

Change-Id: I6fe345df5c417cb7a55a3f91285d9b47a22c04fa
2013-06-04 19:34:36 +02:00
Thiago Macieira
db15341d27 QDnsLookup: test multiple TXT answers too
The TXT record is particular because each RR can contain multiple text
strings. So we need to join each RR's texts too.

To make it easy, I've made everything be QStrings.

Change-Id: Ia0506544b913585e7be860c81077cff8e0dab547
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-04 02:22:47 +02:00
Thiago Macieira
0c8061f608 QDnsLookup: test MX and SRV records that can change order
The DNS protocol changes the order of the RRs in each reply it sends,
in an effort to balance the load in servers. For most tests, to ensure
that we get always the same result, we simply sort it back.

For MX and SRV, we can't sort because we also need to test that
QDnsLookup sorted correctly according to priority. So instead allow
that test to have multiple alternatives.

Change-Id: I5c119f907b31789de5c9cf2471cc82ecd140d06f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-04 02:22:47 +02:00
Peter Hartmann
1c901913c0 QNetworkAccessManager: add public methods to pre-TCP/pre-SSL-connect
If an app knows it needs to connect to a host beforehand, it can "warm up" the
connection cache by making DNS lookup, TCP (and if needed SSL) handshake before
the actual HTTP request is sent. When the HTTP request is made, it will be
considerably faster when there is already a working connection.

Here are some typical results from the benchmark:

* Linux desktop with Ethernet:
  "http://www.google.com" full request: 279 ms, pre-connect request: 61 ms,
    difference: 218 ms
  "https://www.google.com" full request: 344 ms, pre-connect request: 60 ms,
    difference: 284 ms

* mobile device (BlackBerry 10) with Wifi:
  "https://www.google.com" full request: 898 ms, pre-connect request: 159 ms,
    difference: 739 ms
  "http://www.google.com" full request: 707 ms, pre-connect request: 200 ms,
    difference: 507 ms

Task-number: QTBUG-30771
Change-Id: I3566b7f08216ab93a39e2024ae7d1ceb7ae21891
Reviewed-by: Jonas Gastal <gastal@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-06-03 23:16:08 +02:00
Mitch Curtis
15da0a5af2 Make QTime::toString output milliseconds for Qt::TextDate, Qt::ISODate.
Section 4.2.2.4 of ISO 8601 allows for decimal fraction representations
of dates and times. Currently, when calling
QDateTime::toString(Qt::TextDate) or QDateTime::toString(Qt::ISODate),
the milliseconds will be omitted. However,
QDateTime::fromString(str, Qt::TextDate) and
QDateTime::fromString(str, Qt::ISODate) already support decimal
fraction representations, so this patch just adds this support to
QTime::toString, and hence QDateTime::toString().

Task-number: QTBUG-30250
Change-Id: If58e4b3d3105322c51d11a76b832e5e634d8991f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-03 17:05:12 +02:00
Friedemann Kleint
96cd00bc0f widget/graphicsview: Do not run tests showing windows in parallel.
Change-Id: I3bba3f49eba6ca9c187caf696d0f6c73372fec5d
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-06-03 13:48:41 +02:00
Frederik Gladhorn
f89c99fa72 Fix typo
Change-Id: I0983f12759fdb806e4fc89f4abefb9088502208d
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-06-03 13:00:32 +02:00
Friedemann Kleint
fd63f2969e gui/kernel: Do not run test showing windows in parallel.
Change-Id: Ic7457a978c03fcd61cd5ce17dde2b00c74b2fb9a
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-05-30 19:33:25 +02:00
Christoph Schleifenbaum
7ed15da3c1 Core: QDebug and comparison operator support metatypes.
This patch adds a way to enable operator<, operator== and operator<<
into QDebug for QVariants with custom types.

Change-Id: I3d12d891bd7252ad2b8f1de69bced354800a1f29
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-27 19:58:19 +02:00
Thorbjørn Martsum
63354e0d09 QToolTip - add static showText with time.
It is nice to be able to control how long time a tooltip is shown.
This is the first part of solving:

Task-number: QTBUG-1016

Change-Id: I8e313df8a2acdc5ccc91d9c8ce956c30c76daf4b
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-05-27 19:58:19 +02:00
Friedemann Kleint
00ce5a3c1e Remove XFAIL from tst_qgraphicswidget::initialShow2().
The test now passes on Ubuntu, Lucid, too.

Task-number: QTBUG-20778
Change-Id: Id7ddc4b34d03f8fb9af977c0f40615d544934f13
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-05-27 17:47:20 +02:00
Giuseppe D'Angelo
cada1fb4ef Add QComboBox::currentData
Convenience function that returns user data for the current item,
analogous to currentText().

This avoids to having to write the cumbersome

  QVariant variant = comboBox->itemData(comboBox->currentIndex());

(It's quite common to put strings as text and the corresponding
enum values as user data.)

Change-Id: I8c7632c647c5583d18e4e22703aeb4447d73162d
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-05-27 15:19:41 +02:00
Jan Arve Saether
cf366e8b86 Made sure items with preferred width of 0 could also stretch
If no stretch factors were specified, we used the preferred size as a
stretch factor. Obviously, that didn't work if the preferred size was
actually 0.

This patch works around this by actually setting the stretch factor to
1.0 if this is the case.
This should work fine in most cases, except for the case where there
are also other items with a preferred size close to 0.
In this case, the item with preferred size 0 will just grow
faster than an item with e.g. preferred size 0.1.

Task-number: QTBUG-31217

Change-Id: I966455da0bdd00308591c7f7cfbc4e134d423e57
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-05-27 12:38:53 +02:00
Bjoern Breitmeyer
c9e1c947d4 Disabled test on WINCE.
The winapi call used to load the icon does not
support the arguments on windows ce

Change-Id: Ia600eb9b05d5eb40778d8c281e6ce8278bfd7177
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-27 02:45:21 +02:00
Sze Howe Koh
e9723d9d31 QtTest: Output correct library name
"QTest" is the C++ namespace; "QtTest" is the library name

- Edited the logger output in qplaintestlogger.cpp
- Updated documentation
- Updated expected outputs for self-tests

Change-Id: I43c525c43221a8d4e843a00d6d55b0f06ef55fd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-05-27 00:41:46 +02:00
Gunnar Sletta
b571b6329b Update manualtests license to say "part of test suite".
Change-Id: Ice9498c65a20ff17e68303578f8a1d9d6877f501
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-26 20:54:51 +02:00
Gunnar Sletta
32e78f4b6c Manual test for window transparency
Change-Id: I8b9fdd14382904b5a0c2a1ecaabf01b209034b95
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-26 20:48:55 +02:00
Lars Knoll
7878eb6ba3 Fix parsing of long latin strings in the json parser
Latin1 strings are usually stored as 8 bit data in the json binary
format. But that data structure has a size limitation of 16bit, so
we need to fall back to storing the string as 16 bit data if it is
too long.

Task-number: QTBUG-30946
Change-Id: I0069b1367030b0b2f819fd1f04e34c9e2534a2a3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-05-23 22:00:46 +02:00
Frederik Gladhorn
d3a8bc803c Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qdatastream.cpp
	src/corelib/io/qdatastream.h
	src/corelib/json/qjsonwriter.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/xcb/qxcbkeyboard.cpp

Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
2013-05-23 21:27:07 +02:00
Mitch Curtis
964be00403 Fix regression when pasting into QTextEdit from Firefox.
Return the codec if one was found by QTextCodec::codecForUtfText,
instead of returning the default (UTF-8).

Task-number: QTBUG-31293

Change-Id: I95e3260376c00537006b7fbfdc3df5850e1ba657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-05-23 16:55:30 +02:00
Leonard Lee
ad443dfb1d Fix clipping of QTextList decorators.
List decorators may be clipped if you set a large font size and/or
small indent for a QTextList. This fix is to prevent clipping by
moving list decorators and items to left (or to right in case of
right to left layouts) so that the list decorator is always painted
inside the layout.

This commit fixes painting related issue, so auto test is not needed.
The manual test program can be used for verification purposes.

Task-number: QTBUG-5111
Change-Id: I7fdd92399445d33fe9eaf525a05fe5cd860b57c6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-23 12:49:39 +02:00
Morten Johan Sørvig
5d07a4d944 Process initial expose events immediately.
Required to prevent qmlscene flicker on startup.

Also brings back that qWait() in tst_QGL::graphicsViewClipping()
that seems necessary after all.

Amended-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Change-Id: I14ba6e18ac98e5df1ce8ecbc263b30176b67d111
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-05-23 12:49:39 +02:00
Friedemann Kleint
ef8ece3f93 Stabilize tst_qgraphicssceneindex.
Change-Id: I8cda10a5a4c9bf949b560e7be4da9bef92667688
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-05-23 10:02:19 +02:00
Friedemann Kleint
23fd348631 QPrintPreviewDialog: Prevent changing of page in resize handling.
Task-number: QTBUG-14517

Change-Id: I59e444eed8d44be9fb7213fdbab4be473d595be8
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-05-23 09:31:27 +02:00
Friedemann Kleint
d934ddc297 Silently strip leading dot off QFileDialog default suffixes.
Change-Id: Ie41fafe8c2ce7e8ac8dd595ca3809c1da3b386f4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-05-21 07:55:16 +02:00
Oliver Wolff
184e1a37e8 Fixed autotest build for configurations without printsupport
Change-Id: I7fc4a6e4885e9640ecfbe93547fb56868ebba309
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-05-21 07:25:39 +02:00
Stephen Kelly
b88b09fb16 Make it possible to access QPair and std::pair elements from a QVariant.
Change-Id: I9dc73748073d0d1e43bdadbce73339dfcc1bc647
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-20 13:19:16 +02:00
Thiago Macieira
6c98035c99 QThreadPool: Fix regression from Qt 4 in dealing with priority starts
The optimisation done in cbaf52b099 for Qt
5.0 got the order wrong of the comparison. The queue must be sorted in
decreasing priority order. But since higher numbers mean higher
priority, that means the queue must be sorted in decreasing priority
number order.

Task-number: QTBUG-29163
Change-Id: Iaf3424b9bb445bf5c71518927f37253cead454f3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-05-20 12:06:48 +02:00
Liang Qi
57acf1b46c QtCore: fix the number precision in QJsonDocument.toJson()
In JSON, any number is stored in double. We need to make sure we
keep the maximum possible number precision for integer number. In
IEEE 754 double format, the significand precision is 53 bits(52
explicityly stored).

Autotest is included. qint64 and double work fine.

Task-number: QTBUG-28467
Change-Id: I7f857671c50e4334e9329c778f9b4f090f490540
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-05-20 12:06:48 +02:00
Olivier Goffart
e63b831bbd moc: Fix Generator::registerableMetaType
when the type is a pointer to a registerable 1 argument template type.

Task-number: QTBUG-31002
Change-Id: Iac0d6b71b2b805a1876110a0781d02188083c4e5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-20 12:06:48 +02:00
Olivier Goffart
208e9a2757 moc: recover bad template parsing.
When encountering code such as:
  X<a<b>
moc does not have the mean to know if 'a' is a type or a variable, so the
type parser currently assume that '<' always open a template parameter.
(instead of being the operator<)

The type parser do not care about the actual type, it just need to strip
the string out. The problem is that then the whole rest of the file will
be considered as the type.

With this patch, we also stop the parsing at semicolon.  The type will
be wrong, but this allow the parser to recover and it will continue to
look for more classes after this.

(In other words, moc will no longer break if it encounter such construct
in a header. But it will still not parse such types correctly if used
within a Q_OBJECT class)

Task-number: QTBUG-31218

Change-Id: I1fef6bc58493d7c00df72401c9ad55463b24eaa7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-05-20 10:06:04 +02:00
Stephen Kelly
87e27eb870 Add container access functionality for associative containers in QVariant.
Change-Id: I4763a4c157e52918a0a68cba63624c0649aca235
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-05-20 09:09:06 +02:00
Stephen Kelly
1da8cd6e48 Don't test QHash<float, U> or QHash<double, U>
Although it is possible to construct those containers, they are not
usable, as qHash(float) and qHash(double) are ambiguous.

Also don't use CustomMovable as a container key.

It is not equality or lessthan comparable.

Change-Id: I8c7ee068250e2e2b3427769153e3017721c13c50
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-20 09:08:47 +02:00
David Faure
f22b29162c Fix some data races in tst_qthreadpool.
Detected by helgrind.

Change-Id: I5f73a62610b4bdc7f26629f3dcf7b11467897a5c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-05-19 20:39:32 +02:00
Liang Qi
69c05bbef4 QtWidgets: avoid integer divide by zero in QProgressDialog
Autotest is included.

Task-number: QTBUG-31046
Change-Id: Ie549b59112f458de478294fa00443a3cf6898c85
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-05-15 05:06:15 +02:00
J-P Nurmi
0b862e0677 QGV: fix items not to be selected on right mouse button release
Task-number: QTBUG-30990
Change-Id: I421d9169b592da2b468eceb9df4f3f7c6a06e8d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-05-14 15:21:23 +02:00
Tor Arne Vestbø
8be5103d29 tst_qmdiarea: Prevent scrollbars from messing up expected viewport calculation
With scrollbars enabled we would get two resize events when tiling the windows.
First one with the expected viewport size, and then a second one with a bigger
viewport when the QMdiArea calculated that the space it set off for scrollbars
was not needed after all. Depending on whether or not the geometry propagation
of the platform plugin was synchronous or not, we would get one or both of the
events before evaluating the viewport size against the expected size, resulting
in flakeyness, and an expected fail on OS X.

We now explicitly disable the scrollbars during the test, and restore them for
the latter test that verifies that scrollbars show up when the area is resized
below the minimum size of the combined child widgets. This allows us to unskip
the expected failure on OS X, and should make the test less flakey.

Change-Id: Ief767456cfd79f5cd0bb0e220c40e5995674ff71
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-05-14 15:17:18 +02:00
Thorbjørn Martsum
adaa50e37d QHeaderView - add parameter to control sizeHint precision
Currently Qt looks at 1000 rows when scaling a column.
That can be slow in some situations and too inaccurate in others.

With this patch we leave it up to the user to decide how precise
e.g resizeToContents should be.

Change-Id: I6ef60f9a3bb40fc331ce1a1544fdc77488d20ca3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-13 16:32:50 +02:00
Jędrzej Nowacki
14d222cc9d Fix QMetaType benchmark.
Void is not constructible, so there is no point in checking how fast
it can be constructed.

Change-Id: Icb4b607bebce30fff5fc57b105101f019e0e0db5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-13 13:29:48 +02:00
Sergio Ahumada
fc7c25bab5 test: Remove XFAIL from tst_qwidget
XPASS  : tst_QWidget::update() QCOMPARE(w.numPaintEvents, 1) returned TRUE unexpectedly.
     Loc: [tst_qwidget.cpp(4017)]

Change-Id: Ib7664871ed218f4c88fd2430491fa65443651927
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-05-13 13:29:48 +02:00
Kevin Ottens
64a2e00e37 Allow to filter the type of fonts displayed
QFontComboBox had convenient filtering options but somehow not
QFontDialog, so provide the same type of flags and a similar behavior.

Change-Id: Ia8efabc60ae795673c772ff8ed63fd49244a5bb9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-05-13 12:11:21 +02:00
Friedemann Kleint
7cd738a337 Build manual test for widgets from toplevel.
Change-Id: I411cfc28d2021eed0acf3949a141ffded1acdecc
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-05-13 09:06:24 +02:00
Simo Fält
074975055d Disabling some concurrency in widget tests
There has been frequent failures with CI, especially with OSX 10.7.
These seems to work ok in CI node when ran alone but CI is running
those in parallel with some other tests, and this is causing errors,
most likely due to lost focus.

Change-Id: Ic4151099c27a4b5d91778c9b13e88d2d661e8a0d
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-10 17:31:52 +02:00
Peter Hartmann
3be197881f QSslConfiguration: add API to persist and resume SSL sessions
Session tickets can be cached on the client side for hours (e.g.
graph.facebook.com: ~ 24 hours, api.twitter.com: 4 hours), because the
server does not need to maintain state.
We need public API for it so an application can cache the session (e.g.
to disk) and resume a session already with the 1st handshake, saving
one network round trip.

Task-number: QTBUG-20668
Change-Id: I10255932dcd528ee1231538cb72b52b97f9f4a3c
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-05-10 09:15:55 +02:00
Mitch Curtis
9a7bc0fc1b Rename Numpad to Num, ensure Numpad is translated in all cases on Mac.
Numpad is unnecessarily long.

Change-Id: I19a6ce129e26a4f6f8344f514317214c48abde6e
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-05-10 09:10:45 +02:00
David Faure
2116f9904a QDBus: Add test for a{sv} and an annotation pointing to QVariantHash.
QVariantMap would work too; I presume this is why the annotation is needed,
rather than QtDBus automatically figuring out which type to use.

This even checks that QHash&lt;QString,QVariant&gt; works in the annotation,
although QVariantHash would be simpler to write, obviously.

Change-Id: I7a339ca90f10e5ec97dcea1bb4dbba3c515e6b23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
2013-05-10 09:03:29 +02:00
Sérgio Martins
46685f755b Windows: Introduce QFileDialog::DontUseCustomDirectoryIcons
Folders can have a custom icon, set by the user. Some system
folders also have one, for example c:\windows\fonts.

This option allows you to disable this behavior, you'll get the
folder directory icon.

As a side-effect, you'll get a very big performance improvement
on removable/network media: 2 seconds vs 60 seconds on a SDCard
with 10000 folders.

Change-Id: Id55ea628186e0a6523585ec7a4ff622d6f5da505
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-05-09 14:56:32 +02:00
David Faure
12d8264a24 tst_qdbusabstractinterface: generate interface at compile time
in order to test for regressions in qdbusxml2cpp too.

Change-Id: Icd2a6f319c5fabf0b0f2a1fe8c70afcd2c84263e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
2013-05-09 12:35:39 +02:00
Albert Astals Cid
95cab90b10 Make QFlags enum flags (C++11 strict enums) friendly
Change-Id: I9ccb3e4d281a545ca1845db4f6aa7ac6c04e8621
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-05-09 12:17:59 +02:00
Friedemann Kleint
9ddf7c5312 Stabilize QGraphicsWidget test.
The test showed frequent failures with XCB in
initialShow2() (line 3200) after
01bc34088e (QTBUG-30923) which
can be fixed by ensuring the widget from the HFW-test is deleted.

Use QScopedPointer to ensure widgets are always deleted in case
of test failures, too.

Task-number: QTBUG-20778
Task-number: QTBUG-30923
Change-Id: I2af7737b604820463f760d6b6787dd5a5a93d602
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-05-09 10:20:21 +02:00
Olivier Goffart
9cc106d9d7 Fix a case of connect()ing to signals declared in a base class
Fix connection to pointer to member signal that belongs to the base
class, but whose type is a pointer to a member of the derived class.

The current code only use the QMetaObject of the type coming from the
function type to look up the signal id. But if the signal was casted
to a pointer to member function of a derived type, then we also need to
look in the base classes

Change-Id: Ib98fc38f63942946acb34d9f83c100991d58e4e5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-05-09 08:23:48 +02:00
Thorbjørn Martsum
03c5eacfbb resizeToContents - QTableView - faster hint when view is hidden
In some situations we can get into resizeSections in a hidden
QHeaderView. If the headerView is hidden then we look at all the
rows, and that can be extemely expensive for a large model.

This patch limits the sizeHint with only looking at a maximum
1000 rows. Though this is more inaccurate it is also faster -
and it is not much different from what QTreeView does.

Change-Id: Ief4b54c5a3c5a0db02e8b595c9b9b3162633ee67
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-09 06:44:54 +02:00
Stephen Kelly
508ee5616b Add automatic container access registration for built-in containers.
Change-Id: I4d590c23e072994930922ff73367600f848fbcf0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-08 12:45:59 +02:00
Mitch Curtis
83315ce8b2 Revert QDateTime serialisation to pre-Qt 5 behaviour.
In Qt 5, I managed to break the guarantee that a deserialised local
datetime is the same time of day (potentially different UTC time),
regardless of which timezone it was serialised in. This happened after
I fixed QTBUG-4057 with If650e7960dca7b6ab44b8233410a6369c41df73a,
which serialised datetimes as UTC.

This patch reverts QDateTime serialisation to pre-Qt 5 behaviour to
restore the guarantee and consequently re-opens QTBUG-4057.

Change-Id: Iea877f7ed886f530b928067789b53534e89fe8cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-05-08 10:00:29 +02:00
Miikka Heikkinen
01bc34088e Fix tabFocusFirst when that item is removed from QGraphicsScene
If tabFocusFirst is not cleared or set to another valid item,
there will be crash later if the removed item is deleted after
removal.

Task-number: QTBUG-30923
Change-Id: Iba9a6ce9334c52f8e552b0accda95ebb5fcfcdb1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-05-08 06:47:29 +02:00
Stephen Kelly
620f788f86 Add QVariantList extraction from a QVariant with a sequential container.
Change-Id: Id9fac7bf47ed3fbb385222b25941215ac24b8b88
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-05-08 06:02:53 +02:00
Stephen Kelly
01fb843af8 Add QVariant container iteration API.
A new set of classes is introduced for iterating over the contents
of a container within a QVariant without knowing the exact type of
the container, but with the guarantee that the element type within
the container is a metatype.

The implementation of the iterable interface uses
the stl-compatible container API so that we can also iterate over stl
containers, or any other container which also conforms to stl norms.

This enables the functionality in the bug report.

Task-number: QTBUG-23566

Change-Id: I92a2f3458516de201b8f0e470982c4d030e8ac8b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-08 06:02:45 +02:00
Christoph Schleifenbaum
f7b313e6d8 Core: Support for converting user defined QVariant types.
This patchs allows the user to convert defined QMetaType types like
MyType to be converted by using e.g. QVariant::toString(), mapping to
MyType::toString(). Also all the other QVariant::toXYZ() methods are
supported so far.

The patch adds static methods QMetaType::registerConverter supporting:
- implicit convertion
- conversion using member method of source type
- conversion using unary functor

Change-Id: I4f1db83d9c78bcc9df5c42f82f95cce0480cdcc3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-08 06:02:35 +02:00
El Mehdi Fekari
02679d93c4 QLocale: add autotest for French_Morocco locale
Change-Id: Ie489557342bf9ea571ba4070e8982b1a13fc7021
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-05-08 01:14:40 +02:00
Olivier Goffart
263b86a559 moc: use fprintf instead of qWarning
qWarning now depends on QT_MESSAGE_PATTERN, depending on that variable.
It will show things like the moc process id or the Parser::error
function name.  We don't want that.

Change-Id: I5b35401200f0f7de2442aa77d700a82402081489
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-05-08 00:55:15 +02:00
Stephen Kelly
3483336889 Only expect EGL libraries in the cmake files if Qt is configured to use it.
Change-Id: Ida382a80dba882bbeb920756adc0c16321efe37e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-07 22:43:14 +02:00
Giuseppe D'Angelo
66ff3f7fa4 Add qt_hash(QStringRef) overload
This enables fixing a performance regression compared to Qt 4.
Also, add some qt_hash tests.

Change-Id: Id830e17dec99fb67e5930c80029ac2233b2f427e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-07 22:43:14 +02:00
Ivan Komissarov
0866e48ae2 Fixed applying invalid data from QLineEdit to model
Task-number: QTBUG-2216

Change-Id: I5d1c18aadb380667dedc2bb9f9b7e3dd8178a24c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2013-05-07 22:43:14 +02:00
Friedemann Kleint
5a8d58350d Add QSKIP to hoverenter-test in tst_qgraphicsproxywidget.
Task-number: QTBUG-25294

Change-Id: I7a674dc49d84c7c68a877bcf64c14e9726dd481e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-05-07 20:40:41 +02:00
Friedemann Kleint
1cf39e2610 Fix XPASS in tst_qgraphicswidget (Windows).
Task-number: QTBUG-20778

Change-Id: I90c8135fab85872cae22630c53fef7aed835a19c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-05-07 20:40:41 +02:00
Kevin Ottens
48e3cc30ed Set the base used to display the spin box value
Provide a new displayIntegerBase property which control the base used
by the spin box to display the value in its internal line edit.

Change-Id: Ibadc37107db8770d757b64350946bf19142e8f6c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-05-07 18:40:43 +02:00
Joerg Bornemann
28ee554b37 QProcess/Win: drain output pipes on process finish
If a process dies before all output is read into the internal buffer
of QProcess, we might lose data. Therefore we must drain the output
pipes like we already do in the synchronous wait functions.

Task-number: QTBUG-30843

Change-Id: I8bbc5265275c9ebd33218ba600267ae87d93ed61
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-05-07 15:02:34 +02:00
Sergio Ahumada
db44b891fb Merge branch 'stable' into dev
Change-Id: Ica003a10ede86914bbbb062a2dc277a2ce39a259
2013-05-07 12:02:41 +02:00
Thiago Macieira
cd5d1524a0 Autotest: Use the new test zone in all name-lookup unit tests
I also modified tst_QDnsLookup the test to use ';' as a separator as
opposed to spaces because I added MX and SRV records with multiple
RRs.

Change-Id: I62c7b6ad342c1bb23c4d9ac9730e35ab422e3ea2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-05-07 02:53:50 +02:00
Frederik Gladhorn
c917579a15 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-04-30 09:33:19 +02:00
Kevin Ottens
ac06bfdc76 Add QUrl based static methods to QFileDialog
With QUrl variants of the static methods, it is possible to get to use
VFS facilities of the platform if available.

Since we can't predict if the application will use the VFS available in
the platform or its own mechanisms, an extra parameter is provided to
restrict the protocols allowed to the user. This extra parameter
defaults to no restriction, which is the most convenient if the platform
file dialog and the application use a matching VFS. It's likely to be
the most common use.

Change-Id: I4c9effde9d194d226cd8b7a140eb9036187ba87b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-29 18:41:55 +02:00
Thiago Macieira
586fb6d632 Add some extra tests for QString::arg
Test locale-based formatting of numbers when we pass field width, base
and fill characters. This now tests the fact that we replace a '0' for
the locale's zero character.

Change-Id: Ib872a592fd9a754e3ef11495a9497a6947056631
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-29 16:56:58 +02:00
Sergio Ahumada
b27e922e1c test: Mark tst_menubar::task256322_highlight as XFAIL
This test is unstable on Mac OS 10.7 with developer builds, so marking
it as XFAIL if it happens to fail.

Task-number: QTBUG-30565
Change-Id: If7094c3b19299f0dbe57cb82a8614032a75573d8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2013-04-29 14:50:49 +02:00
Frederik Gladhorn
85e3c53e5c Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2a54058b64ac69c78b4120fdaf09b96e025a4c6c
2013-04-29 14:17:09 +02:00
Jan Arve Saether
c29cbfa858 Get rid of this hack where QAccessible inherits from QObject.
This was added just so that moc could pick up the enums and so that
we could use the enums in Q_PROPERTY declarations, which was needed for
accessibility in QML. It turns out that Q_GADGET is enough for us.

This is a strictly a binary compatible change.
However, QAccessible was marked internal in 5.0, so we are free to
change it. In addition, this class is static and cannot be instantiated.

Change-Id: I27e2e97c5f4b45c38678264c6b593a4383db8d3e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-04-26 23:27:18 +02:00
Albert Astals Cid
9b021a1fbd Make QColor understand #AARRGGBB
This way I can have in my QtQuick something like
Text {
 text: "<font color='#ff0000'>H</font> <font color='#99ff0000'>H</font>"
}
and it works properly

QtQuick already supports #AARRGGBB for color: properties so I've
decided to go the notation

Once this is merged we can remove the extra code
in QQuickColorProvider::QColorFromString

I've also added some tests for the hex -> QColor conversion that where
non existent

Change-Id: I1dd4a2ec113293aec26968329b2e4930df6fdcb7
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-04-26 09:59:04 +02:00
Frederik Gladhorn
08585f02dc Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-04-26 09:45:55 +02:00
Andy Shaw
8f125985db Cleanup the SQL tests
This removes some XFAILS that were no longer correct and
fixes some existing problems in the tests where ODBC is
concerned.

Change-Id: I91de526bb50ad4046ba07ddb5336aa3714966687
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-04-25 19:59:16 +02:00
Jan Arve Saether
b9db3e4785 Do not include the treeview header if its hidden
Previously, accessibleTree->child(0) would return an interface for the
header even if it was hidden.

Also, the assertion was wrong since the index would be 0 if both row
and column were 0. The assertion was actually found while using the
project explorer of Qt Creator (2.7)

Change-Id: I9f3cc2c13b6887569d10c4e062a64552f898231a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-04-25 17:56:26 +02:00
Gunnar Sletta
2e0575ce89 Fix windows expose logic
Make sure the value of QWindowsWindow::isExposed is in sync
with regions we expose.

This provoked a couple of existing issues in the qwidget test.

setWindowGeometry tested that windows with invalid sizes got
exposed on screen. They didn't, but because the plugin sent
bogus events, these used to pass. Same with windowMoveResize.

The expect fails are also rather bogus. Showing invalid-size
widgets could be considered undefined behavior. The Window
manager could resize it, choose to not show it at all, etc,
but they now pass on windows.

resizeEvent has been broken since 5.0.0, but the test didn't
spin the event loop so the second event didn't get delivered
before the test completed.

Task-number: QTBUG-30744
Change-Id: I3a9efcd095f366126a87739f4248185b6c81d407
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-25 15:41:54 +02:00
Stephen Kelly
1c17275047 Run the CMake tests with QPrinter, not QPrintDialog.
QPrinter is not implemented on android, so the test fails to
link there.

Change-Id: I10ca0179323362a9c9f74325332043c968d67d3c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-04-24 16:24:40 +02:00
Stephen Kelly
106dc410e9 Use variadic templates to mark function pointers as non-QObjects.
Change-Id: I4d4e7a0498ff8f5b834dae4008d1311838180036
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-24 14:19:26 +02:00
Stephen Kelly
4341ae32f4 Enable OpenGL library detection for mac.
Change-Id: If99d3faf2b08ac5109d619ff69efdaa3857c007f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-24 01:30:20 +02:00
Peter Hartmann
e145b67fbd SSL internals: do not write after shutting down the socket
... but rather throw an error, so the HTTP layer can recover from a SSL
shutdown gracefully. In case the other side sent us a shutdown, we should
not send one as well, as it results in an error.

Change-Id: Ie7a56cf3008b6ead912aade18dbec67846e2a87e
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-04-23 23:22:43 +02:00
Thomas McGuire
e0cf3fcd8f Fix retrieving of the generic system proxy via environment variables
ignoreProxyFor() always returned true if the no_proxy was not set,
which resulted in the first token being an empty QByteArray, causing
the endsWith() check to always evaluate to true.

Add a unit test that is enabled for those platforms that use the generic
system proxy.

Change-Id: I6081ad5e0b8e2c3fee1568835907c32bde5b7772
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2013-04-23 21:02:50 +02:00
hjk
01cbd7e4b5 Remove QLocalePrivate::m_localeID
It was only used for toUpper/toLower but always computed in the
constructor, including QString::toLatin1 conversion and allocations.

This needlessly slows down all other uses, including supposedly "cheap"
operations QString::toDouble, or accesses inside QResourceFileEngine.

The benchmarks indicates that doing it always when needed is bearable.
There's still a lot of improvement potential on these code paths.

Change-Id: I88b637ee11f9f7ea614f8da4ec5df0bf40664fce
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-04-23 18:57:45 +02:00
Jan Arve Saether
146658a10f Fixed QLayout::addChildLayout(QLayout *l) when l had a parent
Previously if l had a parent, addChildLayout would warn and skip the
reparenting, but it would still add the sub layout to the layout.
This caused some inconsistencies in the hierarchy which in worst case
could cause crashes.

Task-number: QTBUG-30758
Change-Id: I618ec3341636b97bd71e421201b22c746dcf43e1
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-04-23 18:57:45 +02:00
Friedemann Kleint
a961204d28 File dialog manual test: Remove dot from default suffix.
Change-Id: Icadfd2103bb89b5f9ea167737d9e6af05d7a6b86
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-04-23 13:55:18 +02:00
J-P Nurmi
a7dc708eb5 Fix QAbstractItemModel::moveColumn()
Task-number: QTBUG-30346
Change-Id: I3d6dbe1e88bb5e2748eadabb2663f30be16f8d18
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-23 13:35:31 +02:00
Mitch Curtis
7dd81686e8 Fix QKeySequence::toString() returning gibberish for Qt::KeypadModifier
This is the patch from the bug report with a few alterations to get it
to compile, and also with the GroupSwitchModifier code removed, as this patch
just focuses on Qt::KeypadModifier. The problem was determined to be in
QKeySequencePrivate::encodeString, which doesn't handle the
Qt::KeypadModifier flag.

Task-number: QTBUG-4022

Change-Id: Ic981eb8b5cd88c7b36892d3019b8175db4b7b6f2
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-04-23 12:26:13 +02:00
Stephen Kelly
bc4fbcd215 Add IMPORTED targets for the GL libraries used by Qt.
There may be multiple libraries specified in the mkspec, such as
EGL and Mali, as used in devices/linux-sh4-stmicro-ST7108-g++, so
create an imported target for each one. Also populate the
Qt5Gui_EGL_LIBS variable with all created imported targets. Similar
variables are created for the used OPENGL implementation.

In the case of using the packaged ANGLE library, we already know the
exact locations of the binaries.

This makes it possible for third parties to use the same GL
implementation as used by the Qt build itself. As these are used only
privately by QtGui, they are also added to the DEPENDENT_LIBRARIES
of that target so that they are found for rpath-link usage.

On some platforms (eg Raspberry Pi), multiple include directories must
be set to include egl.h, as the headers it includes for vcos are a
bit scattered.

Task-number: QTBUG-29132

Change-Id: I1126da3d37cd51c88d3670347c8b6405b285efb5
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-22 18:35:52 +02:00
J-P Nurmi
00b11ccdea Fix QTableView::doItemsLayout()
Keep the content aligned to the bottom when the view has been scrolled
to the bottom and the content is relayouted (for example due to
sorting).

Task-number: QTBUG-30653
Change-Id: I9513e295e276d25ff2068036cd80dbf91314fe84
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-22 18:35:52 +02:00
Christoph Schleifenbaum
ae0fd6884d QAbstractScrollArea - add SizeAdjustPolicy and viewportSizeHint
This patch adds SizeAdjustPolicy to QAbstractScrollArea.
If it is set to AdjustToContents it will make use of the new
protected viewportSizeHint() (BC since it was reserved in Qt5).
This function returns a suggested size based on contents.

Change-Id: I5d8aa517e88b8b21c5712e62b4d574c3aad99d3b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-22 17:56:55 +02:00
Frederik Gladhorn
4c231d5df3 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I059725e3b7d7ffd5a16a0931e6c17200917172b5
2013-04-22 16:35:43 +02:00
Sergio Ahumada
d64274d4ff test: Disable tst_uic when -no-widgets is used
uic doesn't get compiled when -no-widgets is used, so disabling
its test.

Change-Id: I8c81ec468e40841548dacb356fd87ecf85d7b6ac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-04-22 16:24:44 +02:00
Peter Hartmann
7df16fb4cc SSL namespace: Add enum to disable SSL session sharing
There is already an enum to disable SSL session tickets, which has been
used to disable session sharing for now. However, SSL session sharing
is not the same as SSL session tickets: Session sharing is built into
the SSL protocol, while session tickets is a TLS extension (RFC 5077).

Change-Id: If76b99c94b346cfb00e47366e66098f6334fd9bc
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-04-22 10:58:14 +02:00
Andy Shaw
f78842abe4 Ensure the QLineEdit::returnPressed() signal is still emitted
The signal needs to be emitted directly as the event is not passed to
the QLineEdit if the QSpinBox gets the Key_Return. Since this signal
may be relied upon then we ensure it is emitted directly.

Change-Id: I17cdec62c9f995bacfd7d3cc66d6324f26c84c67
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-21 02:01:29 +02:00
Frederik Gladhorn
0d57da067b Let platform plugin decide if accessibility is active
Change-Id: I881a8ff3fedf3db73ee37046a4363c70960a92a6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-04-19 17:52:45 +02:00
Shawn Rutledge
acfccd0483 Fusion & GTK styles need to check direction from style option not qapp
An RTL menu containing a menu item which opens a submenu was showing
the wrong arrow if the application's direction was not also RTL.
So now the test for QTBUG-30595 can be simplified: no need to set
the application direction, and therefore less chance of failure.

Change-Id: Id140656206c6fefea3649289477dc54c77e2dd5e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-04-18 09:18:43 +02:00
Shawn Rutledge
4c7881396e An RTL submenu should be right-aligned
Task-number: QTBUG-30595
Change-Id: Iac54cae70b5a2ac6be5a750279fb390bb158776a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-18 09:18:43 +02:00
Stephen Kelly
bcc14954d3 Update test exclusion following bug fix in recent cmake versions.
Change-Id: I8174ca78b4e2d8b4344278acf8ca4b0db3115d1a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-17 22:14:19 +02:00
Janne Anttila
453e4da6d1 Fix qgraphicsview autotest build for WEC7.
logicalDotsPerInchX returns qreal, and qreal in WEC7 is defined to
float instead  double. There is no required overload:
    qFuzzyCompare(float,double)
And for that reason build fails. Ensure qreal is casted to double which
is default type used by compilers for floating point literals such as
'96.0'.

Change-Id: I24c701715b3dcf1a2137256a1c251c19d0c1dbe9
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2013-04-17 19:49:18 +02:00
Janne Anttila
c6612de314 Fix qsqlquery benchmark test build for WEC7.
WEC7 does not have ws2_32 lib. The lib is needed for gethostname symbol,
instead of using hard coded platform specific libs,
rely on QMAKE_NETWORK_LIBS variable containing network libs.

Change-Id: Ice39ca3f2d176cc5df88beded4b64d2b92f4f3ba
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2013-04-17 19:49:13 +02:00
Janne Anttila
52afd781ad Fix qprocess benchmark test build for WEC7.
Use Q_OS_WINCE ifdef in both method declaration and definition,
in addition combine QT_NO_PROCESS and Q_OS_WINCE ifdefs to one line.

Change-Id: I0787e4341c41b46a5fc089f24a538c0ad40a0875
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2013-04-17 19:49:08 +02:00
Janne Anttila
4f0770eaab Fix tst_qstyle autotest build for WEC7.
Apparently testAllFunctions method has been changed to take pointer,
but code inside different WinCE defines was not updated.

Change-Id: Id15380ecc1e85650d679cb7437923ff9c77057ae
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2013-04-17 19:49:02 +02:00
Janne Anttila
2d73648c71 Fix tst_networkselftest build for WEC7.
WEC7 does not have time() function. Let's use Qt APIs to query time and
initialize random number generator, Qt APIs have already been adapted
to work on all supported platforms.

In addition use QByteArray instead of QString to avoid unnecessary type
conversions later on with toLatin1().

Change-Id: I1ae3729397b0f4a1bd138022a4e122021e10f1e9
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2013-04-17 19:48:55 +02:00
Janne Anttila
0775f88c66 Reduce qmetatype autotest build time for Windows CE.
qmetatype autotest build for WEC7 took several hours [1] See timestamps
03:51:13 and 07:44:52. The timestamped Jenkins log is only available
in Digia network. The corresponding log without timestamps is available
from [2].

Use same workaround for all Windows CE / WEC7 builds as currently
used for desktop MSVC2012.

[1]: http://qt-ci.digia.com/job/QtBase_stable_Integration/cfg=wince70embedded-armv4i-msvc2008_Windows_7/940/consoleFull
[2]: http://testresults.qt-project.org/ci/QtBase_stable_Integration/build_00940/

Change-Id: Ia21be8972d82c8d37073c9097b8d4094261e4126
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-17 19:48:38 +02:00
Janne Anttila
428efd2ebe Fix tst_qfile build for WEC7.
Windows Embedded Compact does not have drive letters like desktop
Windows => do not try to build drive letter related test code for WEC7.

Change-Id: I2c3659220a001510c0555e2dd773b4dd68e9c2cc
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-17 19:48:32 +02:00
Frederik Gladhorn
94758589fe Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-04-17 10:28:21 +02:00
Thiago Macieira
b4ce49287f Make QBuffer::bytesAvailable() work
We don't need to keep an internal QBuffer position, we can just use the
one from QIODevice::pos(). It will keep track of goings ahead and
backwards for us, plus it will make the default bytesAvailable() work
out-of-the-box too.

This error was reported on IRC.

Change-Id: I8559e8ee56edaa01ca8732c1f1012082ebe3a3f2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-04-16 19:45:11 +02:00
Darryl L. Miles
5f9d58848a Json writer, support larger signed integers upto 2^53
Previously only 32bit signed integers were ensured to be supported by
JsonValue type via API but it is expected that a larger integer range
should be supported by a JSON implementation.

This commit brings the Qt implementation into parity with NodeJS
JSON.stringify() in respect of the JavaScript Number type.

Change-Id: If91153cb3b13ecc14c50da97055b35ce42f341e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 22:33:23 +02:00
Darryl L. Miles
6348de8737 Json writer, emit full precision for floating point Number types
Previously Qt JSON writer would only emit 6 digits of precision as this
is the default with the formatter.

However with testing against NodeJS JSON.stringify() this behavior is
inconsistent with the defacto standard JSON implementation and conveys
a loss of precision.

Change-Id: Ie1845a6e0ee0b4c05f63ec0062f372e891855f0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 22:33:19 +02:00
Darryl L. Miles
e2d614b6a9 Json writer, only emit floating point finite numbers, ignore INF/NaN
My interpretation of RFC4627, Section 2.4 "Numbers" of:
  Numeric values that cannot be represented as sequences of digits
   (such as Infinity and NaN) are not permitted.

I have also verified this matter with NodeJS JSON.stringify() that
emitting a null is consistent behavior with a JSON implementation
written in JavaScript.

Previously Qt would emit:
{
 plusInfinity: inf,
 minusInfinity: -inf,
 notANumber: nan
}

Which maybe turned into a string values of "inf", "-inf", "nan" by
the receiving parser.  Now it returns the JSON null value just like
NodeJS JSON.stringify().

Change-Id: I9f9c17f12b2606280806c47a9d90465c4ba5f786
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 22:33:13 +02:00
Frederik Gladhorn
aa3754d105 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Iee73c93067c5822d8dd51a8692e6da9df4ba49f5
2013-04-12 12:53:13 +02:00
unknown
7d56edebc9 QDateTime - Fix auto tests on Windows before 1980
Auto tests using CET expect there to be no Daylight Time before 1980,
but Windows does apply Daylight Time.  Fix expected test results to
match.

Task-number: QTBUG-30420

Change-Id: I7080598fa0a20c1cd5680782606ab983e714e546
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-12 11:46:01 +02:00
John Layt
839a9c11de QPagedPaintDevice: Fix setPageSize() to set correct metrics
Use the correct metrics for the requested PageSize instead of always
defaulting to A4.

Task-number: QTBUG-30494
Change-Id: Ia3978afe3f7cc9b1ded1065416e5c3def44e7a05
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-04-12 11:46:01 +02:00
Debao Zhang
6a50270013 tst_qtranslator: Remove QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Iefd8ce56b7102b5a6a656df7dbea2cd344bb9b5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 07:20:05 +02:00
Debao Zhang
5c2a8899e1 tst_qcoreapplication: Remove QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I6d5098ff57293171b5ddd3a58c53718cbbc8e4bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 07:19:53 +02:00
Debao Zhang
4bb76df7f7 tst_qdataurl: Remove QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I6f2e45bbc6d31cac4d9b8c735650f7985865109c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 07:19:45 +02:00
Konstantin Ritt
b3dae6848d Fix leaking of QFontEngineData
QFontCache now references QFontEngineData-s it maintains,
so that QFont instances not freed prior to calling ~QFontCache()
would destroy QFontEngineData on their own.

Task-number: QTBUG-25434

Change-Id: Ia7679d64de436841f09ac7be62ceb570e50cce5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: jian liang <jianliang79@gmail.com>
2013-04-12 04:23:35 +02:00
Fabian Bumberger
e9760f1559 Fix the check if mouse events should be synthesized from touch events
In QGuiApplication only Qt::AA_SynthesizeMouseForUnhandledTouchEvents
is taken into account when synthesizing mouse from touch events, in
QApplication only the PlatformIntegration syle hint
QPlatformIntegration::SynthesizeMouseFromTouchEvents.

With this patch both attributes are checked. Furthermore the check was
moved out of translateTouchToMouse in QApplication in order not to
influence the result which is returned to the user, when mouse events
are not be synthesized.

Change-Id: I87ac7299f0a9fbf0a083eff9c547f0dbfab75dfb
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-04-11 16:09:19 +02:00
Friedemann Kleint
26da8c34bb Stabilize tst_qcombobox.
- Remove member variable testWidget and instantiate on the stack
  to ensure tests do not interfere.
- Move widgets away from taskbar areas.
- Fix windows geometry warnings by making small windows frameless.
- Fix wrong target widget for key click in
  keyBoardNavigationWithMouse().

Task-number: QTBUG-30573
Change-Id: I6d9fad0f212814a67367baf446750e9bed0ebdb2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-04-11 06:52:07 +02:00
Sergio Ahumada
90297a64f2 Merge branch 'stable' into dev
Change-Id: Icff019d74ae04c628a80f66aa478e4db40fae464
2013-04-10 15:42:22 +02:00
Andy Shaw
f5dc5225f6 When doing a PageDown or PageUp it should show the next set of cells
Before it would skip out a row depending on the size of the tableview.
Now it will show the next set of cells for the direction it is going in.

Change-Id: I02926d0b2187ffafffb63f7fff43c233b4d7d6af
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-09 22:38:32 +02:00
Stephen Kelly
b242ab7b10 Add missing wait for window shown.
Change-Id: I746a12dfa1b87a0d1393341ca3d641f73bcaee0a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-09 19:30:14 +02:00
Volker Krause
96e3c2bcbf Don't bypass overwritten [set]data() methods in the proxy.
By calling itemData() of the source model directly, the result cannot
contain data provided by the proxy model itself. The base class
implementation however will call data() on the proxy instead.

Change-Id: Ib0ef5f5621457adbfa4bd896a756dfcb98d0ae54
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-08 14:17:27 +02:00
Frederik Gladhorn
8307ab784e Make QTextCursor accessibility boundary finder available
This allows re-using the function in QtQuick.
In addition TextBoundaryType is moved to QAccessible
and QAccessible2 as namespace ceases to exist.

Change-Id: I184bc2c181a22ca51ac4db4e5a080dc26d4acfe0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-04-08 11:35:44 +02:00
Stephen Kelly
722798a359 Don't call virtual methods after the source model is destroyed.
Calling clear_mapping causes the persistent indexes to be queried, and
mapped using map_to_source, so that they can be restored later. That
is not the appropriate response to the source model being deleted
because there won't be anything to restore.

Simply clear the stored mapping information instead so that the source model
actually exists when mapToSource is called by the framework.

Change-Id: I99692ee7aa9c6714aec45c68fe4a2d62be189d60
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-05 16:26:06 +02:00
Stephen Kelly
30d01db3a5 Test that the CMake files create appropriate version variables.
Change-Id: I1d8061302fbb8494b5ae31e20a644745fe969f10
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-05 14:20:39 +02:00
Friedemann Kleint
54bd1102ad Stabilize tst_qcompleter.
- Use qWaitForWindowActive in task178797_activatedOnReturn().
- Remove hardcoded timeouts, use qWaitForWindowActive/Exposed.
- Instantiate widgets on stack or use QScopedPointer to ensure
  cleanup.
- Move widgets to a central location, avoiding taskbar areas.

Change-Id: I98991b70067dddab9aa69b1681fa80398ec8b1f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-04-05 11:28:47 +02:00
Andy Shaw
693a399acb Fix sql tests in respect to Oracle databases
Oracle has a limitation of 30 characters for a tablename so the main
change is to account for this, which meant changing all the usages of
qTableName(). Some other fixes are included that ensure the tests are
working correctly as far as Oracle is concerned.

Change-Id: I8ad8a5a33e6a70fcad235f6a7e82e91687b74fee
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-05 11:13:28 +02:00
David Faure
b3a505dc92 QSaveFile: allow saving to a writable file in a non-writable directory
The only way to make this possible is to disable the
atomic-rename-from-temp-file behavior. This is not done by default,
but only if the application allows this to happen.
https://bugs.kde.org/show_bug.cgi?id=312415

Change-Id: I71ce54ae1f7f50ab5e8379f04c0ede74ebe3136d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-05 11:04:35 +02:00
Peter Hartmann
f4714459a8 QTcpSocket bind() auto test: return instead of QSKIP
... because SkipSingle was removed in Qt5, and a QSKIP would result in
the SSL tests not being executed.
This can be reverted once QTBUG-29972 is fixed.

Change-Id: I3663ee52f00c3f4391ce78cf63bd444656d79cb3
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-04-05 10:56:43 +02:00
Frederik Gladhorn
4b069486cb Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-04-04 14:45:28 +02:00
Jan Arve Saether
9d7ae6dfbe Fixed a bug where the MaximumSizeHint of a layout with spans was wrong
This was spotted while tracking down a similar bug related to spans.
This now also eliminates the Q_EXPECT_FAILs in
heightForWidthWithSpanning(), since it now finally works.

The problem was only for the maximum size, since the size of an ignored
row/column was min: 0, pref: 0, max: FLT_MAX (the default constructed
values for a QGridLayoutBox).

Change-Id: Ibb33c26ede40ed02edd26f596ba6133d59c9962f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-04-04 14:23:04 +02:00
Jan Arve Saether
4f072e2d3d Fixed a bug where spans across empty cells got broken.
If a row/column is only used only because of the spanning of an item,
the cell should be treated as it didn't exist. We keep track of this
with the "ignore" bit array.

The old code would always start from the row/column at position 1.
In the attached testcase this made the effectiveRowSpan become larger
than actually needed.

Task-number: QTBUG-30255

Change-Id: Ief0e7018ee8e5ee36272ce075a43312ffeac7b91
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-04-03 14:52:25 +02:00
Frederik Gladhorn
814f713f01 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Id96d4076610366a7cc66c8d8382ca25c33eaa71d
2013-04-03 14:40:26 +02:00
Marc Mutz
76e0223619 Add qPopulationCount() function, extracted from QBitArray
This functionality is used in multiple places in Qt itself, so it makes
sense to have a global function for this. This also allows to map this
onto specialized assembler instructions, should an architecture provide
them, later on.

Also added comprehensive tests, using a 4-bit lookup-table implementation
as a reference.

Change-Id: I8c4ea72cce54506ebb9fbe61141dbb5f1b7a660f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-03 11:38:35 +02:00
BogDan Vatra
448c3e85dd Fix Qt tests for Android.
Change-Id: I53856056a00684a9a37596a74b79f46d3b47331f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-04-03 10:15:40 +02:00
Thorbjørn Lund Martsum
01b4b7f917 GraphicsView - add Q_DECL_OVERRIDE to the manual rubber band test
This adds Q_DECL_OVERRIDE to the virtual functions in the test.

Change-Id: If1b7646c9a6f50c6efe2d03d253bd8e0b4c09716
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
2013-04-03 07:00:12 +02:00
Andy Shaw
406c8ef6e6 Move the dbmstype to QSqlDriverPrivate so it can be used for all drivers
By moving it to QSqlDriverPrivate we make it easier to check what
database is actually connected which is particularly useful for the
autotests.

Change-Id: I54d1c2c998919c1d54efb1b6ac9303070ece54aa
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-02 19:02:26 +02:00
Frederik Gladhorn
b2ec0da956 Cache QAccessibleInterfaces.
Since there already is a one-to-one relationship
between QObject and QAccessibleInterface it makes
little sense to create and destroy the interfaces
on each call to queryAccessibleInterface.

Add a cache and keep created interfaces around for
the lifetime of the corresponding QObject.

This changes the memory management rules: accessible
interfaces must no longer be deleted. If you get an
QAccessibleIntrface pointer that pointer will stay
valid as long as the corresponding QObject is not
deleted.

This also re-enables accessibility for Mac.

We limit the range of the IDs so that they are
useable for Windows directly.
That means we can get rid of the event cache there.

This is based on: Iebf2f374916fc70a9dd29e95f45a6444b85f6cee

Change-Id: I9fe6531812c0dbc5b41101ac05830a6dd75e13a3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-04-02 14:32:25 +02:00
Peter Hartmann
9efd40bd77 QNetworkAccessManager: track online / accessible state without session
In particular, set online state right upon construction of the
QNetworkAccessManager instance. Therefor, QNAM needs an instance of a
QNetworkConfigurationManager internally.
Before, this would only work properly if a network session was created.
Now, networkAccessible() returns the correct status.

Change-Id: I7ff9ccfd18ad376a131fc5977843b55bf185fba0
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-04-02 10:46:23 +02:00
Giuseppe D'Angelo
bb5552a229 Upgrade the bundled PCRE to 8.32
Changelog: http://pcre.org/changelog.txt

Amongst other things, the Unicode tables were upgraded to 6.2.0
and case folding support was added, which also fixes a QString
autotest (marked as XFAIL).

Qt still requires 8.30, not 8.32.

Change-Id: I4056c1dc1d949d33443bb8ca280de4c8c363ac74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-04-01 21:33:29 +02:00
Stephen Kelly
f84cb43eda Add automatic metatype handling for common standard library containers.
Change-Id: I7fc6db6ea71026066d3e3fa4bfd5ecd5c96ad067
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-01 13:49:57 +02:00
Konstantin Ritt
f0af3ed4e5 Update QLocale data to CLDRv23
Say hello to Interlingua and Mongolian once again.

Change-Id: I735fbc5793f34620be1f6932a251224b9ded02e3
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-04-01 12:03:55 +02:00
Konstantin Ritt
bc4dcb6994 QLocale: Report textDirection() by looking to the locale script
Change-Id: Ic562b0301271ba414d5d3ff75a308d84bd288f56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-30 08:23:04 +01:00
David Faure
f052cefc2f tst_qthread: fix race on "bool visited"
Change-Id: I438bad9a4f8afb76272c8d8f08461a6d2c9a0b18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-03-29 15:16:47 +01:00
Morten Johan Sørvig
eb5d8d2fc3 Update the high-dpi manual test.
- Organize the test images into different sizes.
- Add a button and icon drawing test.
- Don't show all tests by default.

Change-Id: I95eff846b8c5159085f53b413dea7212c1ea5071
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-03-29 09:47:32 +01:00
Debao Zhang
c59f1aea65 QtSql tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I93169244b51f8b993f97f7595e0bc7006ae04e3a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-28 14:42:15 +01:00
Debao Zhang
ba3418ae75 QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I1264784d6984edc70bf07e58ed763e1d1b001d7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-28 02:02:14 +01:00
Debao Zhang
f6e739d9e3 QtWidgets tests: Replace qFindChild{ren} with QObject::findChild{ren}
Change-Id: I79a26387bcce0d7f79f4f9f70293e97dae52f949
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 19:34:22 +01:00
Frederik Gladhorn
8b4888afb2 Test with random qobject instead of widget twice
Change-Id: Ibece0f65dafa7fc59486c5a4c1467c93636b93c1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-27 17:16:37 +01:00
Stephen Kelly
ec37cdbc80 Populate includes, defines and pic flags in target interfaces.
Used by features in CMake 2.8.11.

This matches the features in FindQt4 in that version of CMake,
namely that the IMPORTED targets contain the appropriate
INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS
and that the qtmain.lib static library is automatically linked to
on Windows by executables. Additionally, the
INTERFACE_POSITION_INDEPENDENT_CODE property is set appropriately
if Qt requires users to use position independent code.

Change-Id: Ide341f43fcaf7d722a7bdf1a12b1071c7e548ccc
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-27 14:54:49 +01:00
Debao Zhang
1fb3d56efb QtWidgets tests: Don't use the deprecated QTest::qWaitForWindowShown()
Change-Id: I2dd5a54f9485591ca2dab65f7a352ef453c185e2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 06:01:11 +01:00
Debao Zhang
90d74f8602 QtWidgets tests: Don't call the empty function QApplication::syncX()
Change-Id: I2c732afd43586209cf5a2b72caac53e34abb9090
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 06:01:11 +01:00
Debao Zhang
f57a3c0ba3 tst_qgraphicseffectsource: Don't use the deprecated QGraphicsItem::children()
Change-Id: I0cc0c5284a675fb1c7f960e9790baa89c56112b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 06:01:11 +01:00
Debao Zhang
bca0ee7115 QtXml tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Ifb9363fb6d397a91501fc906454e172731d4c06d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:48 +01:00
Debao Zhang
dd4220b6e6 QtGui tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I48c83fa0c5eccd86a5242fc8ed51ac6d7623f7f3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:42 +01:00
Debao Zhang
670aae7d8d QtConcurrent tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Ia0c4751b891ae81a66b072bc504b555d81625172
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:25 +01:00
Debao Zhang
495f7cafdb QtTest tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Id67ab0ea3be47d3b365aa01a354829b8745b7250
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:20 +01:00
Morten Johan Sørvig
b2c73c73cd Cocoa: Correct enter/leave event handling.
Make top-level windows generate enter/leave events
for sub-windows. Keep track of the current "under mouse"
window in mouseMoved and send EnterLeave events when
it changes.

mouseEntered/mouseExited handles enters and leaves
from the top-level window.

Add tests/manual/cocoa/nativewidgets.

Task-number: QTBUG-27550
Task-number: QTBUG-29751

Change-Id: If4b9f9e0f39d9fb05fdab45a100ffdcf107965ad
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-03-26 19:21:38 +01:00
Peter Hartmann
b96e8ff1d2 QNetworkInterface auto test: do not abort without session
... but only if the QNetworkConfiguration manager requires one.

Change-Id: I1c69c43438f1df9080d207c8598a42201f759c5b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-03-26 10:18:02 +01:00
Debao Zhang
d0ad02a766 tst_qtreeview: Use QRect::intersected instead of QRect::intersect
Change-Id: I4579929473a408b73f3ad9014ea30ce5a602259c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-26 10:18:02 +01:00
Eskil Abrahamsen Blomfeldt
83c9d22d44 Remove dependency on QPlatformSupport in fontdatabase test
If you include a static library in the test, all symbols will
be duplicated, and this can cause nasty crashes because global
static data is also duplicated. This happened on Linux because
of a global static cache in the font engine where the two instances
of it would get out of sync, and we would reference invalid
data.

To test QPlatformSupport features, a QPlatformSupport test which
does not load any platform plugin (or uses its own platform plugin
which does not load QPlatformSupport) is needed. For now, I will
just revert adding the test, since it is broken and was added
as part of supporting Windows CE:
   f2fabf77f9.

Change-Id: I6c002d1e0880ee8e031a68eee80e781fe0c62af4
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-03-25 19:21:40 +01:00
David Faure
a6e5ccbe22 QMdi: Don't emit subWindowActivated during StyleChange handling.
The handling of StyleChange de-maximizes the child window temporarily,
which was emitting subWindowActivated.
This would crash lokalize, because deactivating a window means deleting
the widgets associated with it, and style-change handling is done in
QApplication by looping over QApplication::allWidgets, which would then
contain dangling pointers.

Full valgrind log at https://bugs.kde.org/show_bug.cgi?id=271494#c7

Change-Id: Ifb24032cde2cd470dcae7cd553ec5ab45a919dd6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-25 10:37:37 +01:00
Mitch Curtis
a3304489e8 Ensure QTemporaryFile can create files when an identical dir exists.
When QTemporaryFile attempts to create a new file in
createFileFromTemplate, it fails if the filename exists and is a
directory. Windows returns error code 5 (ERROR_ACCESS_DENIED) in this
case - rather than ERROR_FILE_EXISTS - which is not handled.

This patch handles ERROR_ACCESS_DENIED in addition to the already
handled ERROR_FILE_EXISTS, meaning that QTemporaryFile will continue
to look for unique names when a directory with the same name exists.

Task-number: QTBUG-30058

Change-Id: I42339887d7f5483e3dc6a03a9da15111c350da8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-23 14:42:45 +01:00
Frederik Gladhorn
6d9541ae96 Do not update accessibility for invalid interfaces
Change-Id: I8dc29ea51393406e529c76f25bf2f8cf426e26cf
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-23 11:43:39 +01:00
Friedemann Kleint
37842c2fdb Compile most manual tests with Qt 4.
Replace <QtWidgets> includes by class includes, remove tests
that do not compile.

Change-Id: I52837e8c567dc8ac365c7d43c37beb9a368f6f72
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-03-22 19:52:26 +01:00
Frederik Gladhorn
4e07286a30 Only instantiate QAccessibleWidget after trying inherited classes
The plugin should try each class name from the meta object
in succession instead of giving up right away and just using
QWidget.

This improves the handling of the itemviews and makes many sub-classes
of QWidget outside of Qt work.

Change-Id: Id81017c648fe229c3eb85d6d9ae6696d5f16a1ef
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-22 17:11:17 +01:00
Samuel Rødal
2ab9b747fc Merge remote-tracking branch 'gerrit/release' into stable
Conflicts:
	configure
	mkspecs/features/qt_module_headers.prf
	mkspecs/features/qt_tool.prf
	src/angle/angle.pro
	src/tools/bootstrap/bootstrap.pro
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
2013-03-21 08:49:01 +01:00
Sergio Ahumada
e5a11fbb32 Merge "Merge branch 'dev' into stable" into refs/staging/stable 2013-03-20 23:30:31 +01:00
Israel Lins
0646d1131b ODBC: fixed consistence of return of QODBCResult::exec()
The QODBCResult::exec() returns false when query is an delete
with no data do delete caused by SQLExecute function returning
SQL_NO_DATA, but the false return means error on execution.

Task-number:  QTBUG-10569
Change-Id: I6c7ebadcf62ab404b60c7bcccdab6a10bf16a923
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-20 23:30:23 +01:00
Samuel Rødal
678320788e Skip unstable tst_QSslSocket test case.
The connection to qt-project.org seems to be the one that causes this
particular test case to fail.

Task-number: QTBUG-29941
Change-Id: Ie5e430646997e86e3acb04132cd90a1773a091da
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2013-03-20 16:11:40 +01:00
Oswald Buddenhagen
76c0be34cd Merge branch 'dev' into stable
This starts Qt 5.1 release cycle

Conflicts:
	src/gui/text/qfontdatabase.cpp
	src/gui/text/qharfbuzz_copy_p.h
	src/widgets/kernel/qapplication.cpp
	src/widgets/kernel/qcoreapplication.cpp

Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
2013-03-20 13:49:28 +01:00
J-P Nurmi
5fd509c4d7 Tests: stabilize tst_QDockWidget on small screens
The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Id8ce63b2b88cbed964e0330633c5d2e1dc33598c
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
(cherry picked from commit 36e6632fa3)
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-03-20 09:58:06 +01:00
Samuel Rødal
677313fc0b Attempt to prevent tst_QWidget::scroll() from failing in CI.
Skip the test on X11 where it's consistently failing in CI but not when
trying to reproduce locally. Also attempt to make test slightly more
robust on other platforms (it's already #ifndef'd for Q_OS_MAC).

Task-number: QTBUG-30271
Change-Id: I6743eb99549abbd945e380a3a54ce8620000298a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-20 09:58:03 +01:00
Konstantin Ritt
36cb3f3f65 Fix the font engines leaking
1. when there were some engines with ref > 1 in the cache, prior to calling
   QFontDatabase::{add,remove}ApplicationFont()/removeAllApplicationFonts()
   (QFontCache::clear() has never decreased engine's cache_count);
2. when the QFontEngineData's engine is not in cache i.e. the Box or Test font engine
   (~QFontEngineData() didn't free engines it keeps).

Instead of using the font engine's (external) "cache_count" counter,
QFontCache now references a given font engine every time it is inserted to
the cache and dereferences exactly that number of times in clear().

Change-Id: I87677ebd24c1f4a81a53526f2e726e596b043c61
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-20 07:02:29 +01:00
Olivier Goffart
bc98bba2f3 Support connection to functor with multiple operator()
When variadic templates and decltype are supported, detect the best
overload of operator() to call.
Currently, the code takes the type of the operator(), which requires that
the functor only has one, and that it has no template parameter.

This feature is required if we want to connect to c++1y generic lambda
(N3418)

Change-Id: Ifa957da6955ea39ab804b58f320da9f98ff47d63
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-03-19 23:16:38 +01:00
Stephen Kelly
bc1fb206bb Run CMake dbus tests if dbus is expected to be available.
Instead of first finding it and then testing that we can find it.

Change-Id: I1a1090693520b1d6adadef93839f25d277947e76
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-19 11:26:41 +01:00
Thiago Macieira
537679cb12 Fix wildcard signal disconnection in QDBusAbstractInterface
This has been broken forever, just like generic signal
disconnection. It didn't use to show up before because in Qt 4,
QObject's destructor would not call disconnectNotify().

Just like in the previous commit, we need to verify whether the signal
was disconnected from the last receiver. A wildcard disconnect might
be disconnecting only from a specific receiver.

Task-number: QTBUG-29498
Change-Id: I0790128ea878fdf3ac563c99d96c6aa7d270e9a3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-19 07:03:25 +01:00
Thiago Macieira
d2a98df9bc Make sure that signal disconnects don't disconnect too much
There has been a latent bug forever in QtDBus that would make a signal
disconnect actually disconnect too much. The reason is that
disconnectNotify() is called every time a signal is disconnected from
a receiver, but that doesn't mean it was the last connection.

This test checks whether disconnecting from voidSignal() to our test
receiver will also disconnect from exitLoop(). If it does, we'll get a
timeout. I could have implemented it with two receivers, but in the
buggy case, it would always fail first in the timeout verification.

Change-Id: I5766d8a38594eb25e65b304913251303660fad41
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-19 07:03:17 +01:00
David Faure
a1bc48422f tst_qlockfile: increase delay on Windows.
OpenProcess + WaitForSingleObject is supposed to fail after the process exits,
but this seems to take some time until Windows notices.

Change-Id: I942a9b4a458c23fc4ac33b28386e28821128e991
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-19 06:29:13 +01:00
J-P Nurmi
0554341d9f Tests: stabilize tst_qwidget::scroll on small screens
The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Ie319892747bee60ea6f11e27b6c1bfb4731ef587
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-03-18 22:32:15 +01:00
J-P Nurmi
36e6632fa3 Tests: stabilize tst_QDockWidget on small screens
The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Id8ce63b2b88cbed964e0330633c5d2e1dc33598c
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-03-18 22:32:15 +01:00
Stephen Kelly
4111a676f1 Make the qtbase cmake tests work without the Widgets module.
Task-number: QTBUG-28540

Change-Id: I916d104c8aba551ee9a5b34da3fd85dcb26bbf64
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-18 20:17:10 +01:00
Laszlo Papp
4905c0754b Add convenience distance methods to QVector2D
Change-Id: I8ecdda35912a95e69c2f8dd98ce9c41c77b222d2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-18 08:36:03 +01:00
Olivier Goffart
b8d08c0e9a Fix tst_moc when variadic macros are enabled
moc do not see Q_COMPILER_VARIADIC_MACROS as defined (because it does
not know the builtins defines)

So it would never parse those macro, and never generate the signals or
slot.

Always let moc parse the variadic macro, and put non-macro function in
the header so the generated code would compile on every compiler

Change-Id: Ie9504539ee737c81e831b217f8d623fe810d9e35
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-17 10:57:49 +01:00
Axel Waggershauser
b11317a643 Whitespace cleanup: remove trailing whitespace
Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.

Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp

Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.

Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-16 20:22:50 +01:00
David Faure
72367a94a7 tst_qlogging: fix test when QT_MESSAGE_PATTERN is already set
Change-Id: I608ac9920e04eb636c8d2e9cee38c6f0cd189f1f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-03-16 00:12:47 +01:00
Thiago Macieira
6c48b9ad87 Remove bogus portion of unit test
In Qt 4, QSignalSpy didn't *really* connect to the signal it was
spying on. See the "we need to connect the signal somewhere in order
for D-Bus to enable the rules" comments.

In Qt 5, it connects, which rendered this section of the test bogus:
since the signal is still connected, the QSignalSpy will notice that
fact and will not be empty. This is passing due to a false
positive. The upcoming fix breaks it, so we need to remove it.

Change-Id: Ic8fbf7d0e941403e97149f5bc392334a52c66ab1
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
2013-03-15 21:37:51 +01:00
Laszlo Papp
d8bef6bb2e Add a minor convenience for calculating the distance to a point
Change-Id: I312727bf6858ead6c30fe20bf3abc5afc73a3a14
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-03-15 18:37:51 +01:00
Stephen Kelly
d87c5db10a Make cmake tests not depend on QtWidgets where not needed.
Change-Id: Ib6347360d678bbe54445ebb0680ad66d77a7f3c7
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:30 +01:00
Stephen Kelly
d0ea65b5cb Clean up cmake test regarding dependencies.
There is no need to list the dependencies of the Widgets module.

Change-Id: I9469d4f352685f7122a258f1a44bd017fdc5b3a7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:23 +01:00
Stephen Kelly
ff84d2258f Don't fail on tst_QSslSocket::setReadBufferSize_task_250027
It is flakey and often blocks integration.

Task-number: QTBUG-29730

Change-Id: I8acfc243ec6a6782b7f7d78fc27827f3fdc1ce52
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:03 +01:00
Friedemann Kleint
b0573e4f41 Add missing .pro-file for qpainfo-test.
Change-Id: I75fb11698d3ae305751da59af03c1853add7122e
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-14 19:49:38 +01:00
Fabian Bumberger
09fc0d60e8 Fix qmath autotest for arm
Change the data type of PI from qreal to double, because qreal is defined as float and not as double on arm.
The testcase however expects PI to be a double value.

Change-Id: I003481071ecb2c1f54e6dcee9b450da2f1654969
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
2013-03-14 19:49:38 +01:00
Frederik Gladhorn
d1d0df8fb6 Make qaccessible2.h internal.
This should have been done right from the start,
instead we only made the documentation internal.

Also remove the classes from the BIC data.

Change-Id: I238a7a7cc5d26980b23931c78e7e5a4477d46920
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-14 19:49:38 +01:00
Stephen Kelly
0ec541c9ad Test the OpenGLExtensions cmake module.
Change-Id: I3cc71e035fd1c34e05ecb470f897a72a39f42ca4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-03-14 16:38:57 +01:00
Samuel Rødal
c7191d3e21 Fixed artifacts when drawing same line with different clips.
Expanding on the change fixing QTBUG-24762 with the realization that any
line needs to be drawn in a consistent way regardless of system or
painter clip, not just dashed lines.

Task-number: QTBUG-25036
Change-Id: Ief7ef19cc92c52e7d792500a581a072ba032767e
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-14 12:37:20 +01:00
Stephen Kelly
2a388e503f Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-03-13 23:35:18 +01:00
Axel Waggershauser
3c2748afd5 Improve warning messages (and readability) of connectSlotsByName()
While adding a test case for the new behavior, two issues
with the connectSlotsByName implementation came up:

  1. for auto-connected slots that don't exactly match a signal,
     a 'compatible' one is searched. There might be more than
     one of those. The implementation randomly picks any.
  2. The "No matching signal for %s" warning gets printed even for
     slots that can never be connected via connectSlotsMyName
     anyway (e.g. "on_something"). This is inconsistent.

This fixed both: an explicit warning is printed if more than one
'compatible' signal is found and the "No matching signal for %s"
warning is only printed if the slot adheres to the full
"on_child_signal()" naming convention.

In the process I added comments and changed the code slightly to
make it more readable and explicitly hint at non-obvious behavior.

Change-Id: Icc8e3b9936188d2da8dfff9f0373c8e5c776eb14
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-13 18:40:26 +01:00
Friedemann Kleint
696281bf08 Add qpainfo manual test.
Print out available information from QLibraryInfo, QStandardPaths,
QSysInfo, QPlatformIntegration, QStyleHints, QPlatformTheme
and QScreen.

Change-Id: Ia0bdc6174a1748c539acee18ba16a27a48d58ee5
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-13 18:40:26 +01:00
Israel Lins
36b6d4afc9 ODBC: fix loss of milliseconds when binding QDateTime
Caused by operator precedence error.

Follow-up to commit b8b79a0f37

Task-number: QTBUG-2192
Change-Id: I17decd18c469b48a0bc938ae05c16cced8042219
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-13 17:27:57 +01:00
Marko Kangas
18be0749eb Fix for Sql query aliases with dots
Task-number: QTBUG-14904

Change-Id: I98a02d4bbf28522cd5c2f65ea606b6b26977e8e6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-13 17:27:36 +01:00
Friedemann Kleint
cc58912acd Stabilize tst_qscroller on Windows.
Change-Id: I2331f140e19ed6a2f78e48c91c653f483d8f3347
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-03-13 17:17:54 +01:00
Stephen Kelly
91cd2009bd Generate a Qt5ConfigVersion.cmake file.
This allows finding a minimum particular version of Qt 5.

Change-Id: I96112f1be90f397ec60a2b233989ac0e0380bef9
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 16:07:09 +01:00
Jan Arve Saether
75614792fa Fixed bug in QTimeLine::setPaused(false)
The problem was that the elapsed timer was not restarted,
causing the currentTime() not being adjusted for the time
it was paused.

Task-number: QTBUG-30108

Change-Id: Ib9b2c5a0dea52762109e0b25f1068dd7c88e15ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-03-13 14:51:05 +01:00
Friedemann Kleint
f75b7e78a3 Manual file test: Add permission and compile with Qt 4.8.
Change-Id: I604b3107d3e049af5cd14ae5bf5bd6785330eac7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-13 14:46:26 +01:00
Konstantin Ritt
0194fa135b Hide Harfbuzz from the outer world
Don't export, don't generate private headers, don't mention HB in API.

Change-Id: I048ebd178bf4afaf9fda710a00933b95274cf910
Reviewed-by: Josh Faust <jfaust@suitabletech.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-13 14:46:26 +01:00
Stephen Kelly
d89fe1c7b3 Test that the ConfigVersion.cmake files work.
Invoking find_package with a version but without the version
file present results in an error.

Change-Id: I29d662081ad5dbd7b2259abeec06affda97cbb6a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 09:48:58 +01:00
Stephen Kelly
8cdcff460d Clean up the CMake dbus module test.
The DBus module is aware of its QtCore dependency, and it doesn't need
to be found explicitly. This test probably dates from when that was not
the case.

Change-Id: I3c78997660efed14d84b062d38d8c68dd4f7ae56
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 09:48:26 +01:00
Friedemann Kleint
74494ea29e Fix building of the manual tests.
Adapt to API-changes, exclude network/SSL-tests for Windows.

Change-Id: I80d5ef1bd81e149a2f04fa7644376a8a88b1f7b9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-13 06:23:27 +01:00
Konstantin Ritt
f69c9059d6 Replace HB types used in API with Qt analogs
hb_uint32 <-> quint32
HB_Glyph <-> glyph_t
HB_Fixed <-> QFixed, HB_FixedPoint <-> QFixedPoint
HB_GlyphAttributes <-> QGlyphAttributes

Change-Id: I4338ec4ce9a9c20ea591606ab10e6ef4f19931b8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 18:13:37 +01:00
Friedemann Kleint
b047f48612 Do not list desktop widgets and desktop screen widgets as top-levels.
Change-Id: Iea4905d802213848594d2ad0266696e5edb884f8
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-03-12 18:13:37 +01:00
Paul Olav Tvete
08343e41a0 Skip unstable autotest
tst_QSharedMemory::simpleProcessProducerConsumer is on the top list of
unstable autotests. Disabling it for now.

Task-number: QTBUG-25655
Change-Id: Ib297b3382b736794bab6cdb668103bef74a55d8c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 18:13:37 +01:00
Tor Arne Vestbø
bb2d95ce43 Skip more QScroller tests on Mac, they are all flakey
Task-number: QTBUG-29950
Change-Id: Ieda94dbcab3d75678597544a029c5ca6d2dc8226
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-12 18:13:37 +01:00
El Mehdi Fekari
d7c2227651 Add an auto test for Irish locale
Change-Id: I2458cb580553ea02461869220fbd5dfb0f8fcb2c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 18:13:37 +01:00
Caroline Chao
a410273fab Fix wrong initial position
If the widget is larger than the screen,
its title bar top left corner will be shown
inside the screen.

Task-number: QTBUG-30142

Change-Id: Id93773874be3616b3ef4b9bee6e1bb751c541d7b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-03-12 15:59:21 +01:00
Mitch Curtis
c1771a78ed Correct QString's warnings involving QRegularExpression.
Replaces "QRegularExpresssion" with "QRegularExpression" and adds some
auto tests for the warning itself.

Task-number: QTBUG-30054

Change-Id: Iba333a4388795eccca809fb430c295f503794263
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-03-12 11:43:01 +01:00
Mitch Curtis
6bc691dde5 Revert 6497649730 and clarify docs.
It introduced a regression by requiring that a p/P was also present:

QTime time = QTime::currentTime();
qDebug() << time.toString("h:mm:ss a");
// Outputs "10:05:42 am" in Qt 4.8.
// Outputs "10:05:42 a" with 6497649730.

This patch also clarifies the QTime::toString(QString) documentation.

Change-Id: I4d73a959c2ca76304f03a4ce9717b540ad4e8811
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-03-12 11:43:01 +01:00
Friedemann Kleint
62fe32b37c Fix warning about unused function result in tst_qnetworkproxyfactory.
Change-Id: I1f996c208e05e456d374726c91a5f52ed64f784c
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-12 09:16:42 +01:00
Friedemann Kleint
eccef8c936 Fix warnings about overloaded virtuals in tests (CLANG).
Change-Id: I2f96073c4aaf4b11221b98cc6c7031b253a3b45c
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-03-12 09:16:42 +01:00
Tor Arne Vestbø
77f7a8ef4c Skip tst_QScroller::scroll(), it's flakey and blocking CI
Task-number: QTBUG-30133
Change-Id: I2d91d92e49480b904dec9807d4763c461e809bd2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Paul Olav Tvete
9226a754fd Android: disable unsupported autotests
We do not currently have shared memory or system semaphore support
on Android.

Change-Id: I8e8f3fc6ff8d6de0333002c3e1b31cf070416dbd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Paul Olav Tvete
a90c635d10 Android compile fix
Android is not a proper Linux, and in particular it does not have
pthread_yield().

Change-Id: Ibf94cfacdc24d0c3baaef002c64f9f50c72c01d2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Paul Olav Tvete
271d4af3ac Compile fix when fileno does not return int
This broke the build on Android where fileno returns a short.

Change-Id: Ic8d32380078faeedcd22e785a912fede28251156
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Frederik Gladhorn
72e5124b85 Merge remote-tracking branch 'origin/release' into stable
Conflicts:
	tests/auto/opengl/qgl/tst_qgl.cpp

Change-Id: I3c601351c984c1f4b00478d3c47ac9eeb021e892
2013-03-08 16:11:33 +01:00
Axel Waggershauser
6b68be9587 Let QMetaObject::connectSlotsByName(o) also check for signals of o
QMetaObject::connectSlotsByName(QObject* o) creates a list of all
children to look for signals that match slots of o. This changeset
simply adds the object o itself to that list.

The motivation is to finally fix the long standing QtCreator bug
QTCREATORBUG-6494. Where executing 'Go to slot...' and choosing
'accepted()' for a simple QDialog named 'MyDialog' will add a
on_MyDialog_accepted() slot to MyDialog. That slot never gets
connected. More details may be found in the linked QTBUG-7595.

Task-number: QTBUG-7595
Task-number: QTCREATORBUG-6494

Change-Id: I35f52761791af697eabb569adb5faee6fae50638
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-07 08:37:26 +01:00
Alberto Mardegan
079e3b4f3e Add manual tests for X11 embedding
Since we currently implement only half of the XEMBED protocol (we lack
the container part), we use a simple XEMBED container built with Gtk+
and PyObject. Using an interpreted language as Python helps us avoiding
a build dependency on Gtk+.

Change-Id: Ibc6282371c6f767e481c8a8ba2b5ca9cdd0d8b82
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-07 08:37:26 +01:00
Thorbjørn Martsum
3222db0937 QVector - removeLast optimize
In case somebody uses QVector as a stack, it is not fair to have
takeLast, removeLast and pop_back to do way too much work.

This is still very slow compared to std::vector::pop_back
(mostly due implicit sharing), however it is more than a
factor faster than before.

Change-Id: I636872675e80c8ca0c8ebc94b04f587a2dcd6d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-07 08:37:26 +01:00
Friedemann Kleint
583349de03 Stabilize tst_qclipboard.
If the process terminates while QApplication::processEvents()
runs, the subsequent waitForFinished() returns false and the test
fails.

Task-number: QTBUG-29951
Change-Id: I41f461358920ad430951613dd919885f68ae212c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-07 07:10:35 +01:00
Thorbjørn Martsum
ab52e72292 QVector - add functions takeFirst and takeLast
This patch adds takeFirst and takeLast which are functions
that QList also has.

Change-Id: I761f90b529774edc8fa96e07c6fcf76226123b20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-07 06:13:06 +01:00
Thorbjørn Martsum
510660080d QVector - add remove functions
This patch adds the functions removeFirst() and removeLast().
Functions that QList has.

Beside making these functions, pop_back and pop_front are
redirected to these rather than calling erase.

Change-Id: Ifc5f8a78e33f436f06f21095a920ec5d4311fd6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-07 06:12:59 +01:00
Samuel Rødal
a12f6ba302 Fixed dashes being rendered differently depending on system clip.
We need to clip lines to the unclipped device rect in the case of
dashing, since otherwise the dashes will be shifted and rendered
differently when partial repaints are done.

Task-number: QTBUG-24762
Change-Id: I3599b54baa552acc20bf8cc2e12f846b45f6019e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-07 02:54:08 +01:00
Samuel Rødal
7128bcbbd5 Attempt to stabilize tst_qgl::graphicsViewClipping().
Make sure the graphics view is exposed and has been painted before
trying to grab the framebuffer.

Task-number: QTBUG-29943
Change-Id: I2945cb78b58265864744a0d5fc99fb430306b578
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-07 00:45:04 +01:00
Kevin Ottens
2d1f3d7c51 Add methods to convert lists of QKeySequence to/from strings
QKeySequence provides conversion to and from strings. But a similar
convenience was missing for QList<QKeySequence>. It would come in handy
when you want for instance to save/restore the shortcuts of a QAction.

Change-Id: I9e4f2001c58a595392a5019a57c564992c39bf88
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-03-06 21:50:28 +01:00
Axel Waggershauser
6d0a685fc6 Simplify further extension of tst_QObject::connectSlotsByName
I changed the existing test-case code to make it more scalable
in terms of adding more connectSlotsByName related tests. The
old "manual list of ints"-method was really not developer friendly.

This is a preparation for a subsequent modification of
connectSlotsByName behavior.

Change-Id: Ib760e52631ce4b5ae2a3ebdb4854849ff6c93bfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
04285d94e8 Fix warning about float truncation in tst_qdatastream.
Change-Id: I8e6af7e6534272d1385020212ad7348d9d74b38d
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
a6d339fd18 Fix loop condition in tst_qhash (CLANG).
Change-Id: Ic841abdf45cd2543500b3dc4030bea5f6fd88174
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
90a277bce3 Fix warning about tautological comparison in tst_qstandarditem (CLANG).
Change-Id: I87e3705b8e03ca84c90783b29f95ad19e5f33b74
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
d8e767e928 Fix warnings about unused field variables (CLANG).
Change-Id: I488ad18eb0389d1e9b8b695b7a02eca47bee687e
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Jan Arve Saether
aa2d10750a Fixed QTreeWidgetIterator to work with sorted QTreeWidget
We cannot access children directly, since that won't ensure that
the pending sort is executed. However, the functions we need are
there already and actually makes the code nicer.

Task-number: QTBUG-29903

Change-Id: I6899284275dd79b991896a5f08486b58d95f819d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-03-06 19:13:28 +01:00
Thorbjørn Martsum
f0533ba8c2 QMap - add multiInsert with hint
This provides a fast multiInsert in QMap (and a fast insert in
QMultiMap) when providing a correct hint.

Change-Id: I3c864c3a7842765fe63f8ecb4b54d0e8c9fd22d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-06 18:56:30 +01:00
Thorbjørn Lund Martsum
ca6a4258d0 QMap - add insert overload that provide a hint
This adds a fast insert on QMap when providing a correct hint.

Change-Id: I256bba342932c1d4f24c6e65074e1bf47b519537
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-06 18:56:17 +01:00
Samuel Rødal
711773776e Fixed potential access violation in QPixmap::copy() for <32 bit pixmaps.
QImage is supposed to maintain the invariant that each scan-line begins
on a 4-byte boundary, so we need to verify that this is the case before
using the optimized path of short-cutting QImage::copy() by referencing
the source image's bits directly.

Task-number: QTBUG-14766
Change-Id: I0a178aeb2f34cc64f98deae9470b55b5c53fcb06
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-06 15:00:35 +01:00
Frederik Gladhorn
49a2ec05b4 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/qnx/qqnxscreen.cpp
	src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

Change-Id: Ib64f21c077b54f2291d19187590bfe869b98477a
2013-03-06 14:38:07 +01:00
Morten Johan Sørvig
7ee4ab1463 Cocoa: Improve expose event handling.
Send expose events on window and view show/hide
notifications. Implement QCocoaWindow::isExposed.

Close all windows on quit. This allows sending (de-)expose
events for those windows while the event loop is running.

Remove the flushWindowSystemEvents call in setVisible.
This function is called from application code. Flushing
window system events here is wrong since it can lead
to events being processed in the middle of the user
code call stack. flushWindowSystemEvents should only
be called as a result of (native) window system activity.

Skip one of the tst_qtooltip tests which becomes unstable/
fails in the CI system as a result of this change.

Task-number: QTBUG-29583
Change-Id: I3fb8b3f77e2b2e19dfeafba5d7dfcef602891d37
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-06 11:43:22 +01:00
Frederik Gladhorn
b861063873 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-03-06 00:11:52 +01:00
Fabian Bumberger
4f60ff6ad3 Do not build qsharedmemory and qsystemsemaphore autotests on QNX
QSharedMemory and QSystemSemaphore are not available on QNX so the autotests can not be built.
Change-Id: Ibfb405f951d21342d64bf215cedc203a8cefe070
Reviewed-by: Wolfgang Bremer <wbremer@rim.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 21:56:52 +01:00
Tor Arne Vestbø
d28073d9eb Distinguish between 'mac' and 'macx' qmake scopes
The former applies both on Mac OS X and iOS, but 'macx' is specific to
Mac OS X.

ios.conf and macx.conf now share most of their settings in the common
mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so
that any overrides in the device config will apply afterwards. This
means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK.

Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-03-05 20:59:45 +01:00
Thiago Macieira
950b35cf97 Clear the current thread data for the main thread
This avoids crashes accessing deleted memory when creating a QObject
after the last QObject had been deleted, like a qDebug() in global
destructors.

==41000== Invalid read of size 4
==41000==    at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208)
==41000==    by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147)
==41000==    by 0x5F24051: QThreadData::ref() (qthread.cpp:100)
==41000==    by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681)
==41000==  Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd
==41000==    at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480)
==41000==    by 0x5F240BF: QThreadData::deref() (qthread.cpp:109)
==41000==    by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268)

The comment right above the change in qthread.cpp looks eerily similar
to the problem I'm trying to fix. However, the actual change that
introduced the change is not in the Qt public history, so we can't
know for sure what the problem was then.

Change-Id: I0dba895b041fe6cf81e6f8939ca85035cd00aad1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-03-05 20:58:00 +01:00
Corentin Jabot
866a5d0c28 Make QProcess startable with open()
Add setProgram() and setArguments() methods to the QProcess api.
Add a convenient start(QIODevice::OpenMode) method.
Move the implementation of QProcess::start() to QProcess::open()
unifying the QProcess api with other QIODevice subclasses.

Change-Id: Id1af57da05f750fe8d526d391589c05ee8037bca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 18:39:35 +01:00
Friedemann Kleint
2759761824 Manual dialog test: Add a page for QWizard.
Task-number: QTBUG-29904

Change-Id: I47df03b0d724ccd156a2854602c41e8f1f2a1d5b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-03-05 18:39:35 +01:00
Frederik Gladhorn
5e8ae03578 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/kernel/qtimerinfo_unix.cpp
	src/plugins/platforms/cocoa/qcocoabackingstore.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/plugins/platforms/xcb/qglxintegration.cpp

Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
2013-03-05 13:42:11 +01:00
Laszlo Papp
80af204297 Return -1 as the API documents it for socket issues
Task-number: QTBUG-30024
Change-Id: I51498e6d74ab139134abfb94f35647e995319ee8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 12:19:08 +01:00
Paul Olav Tvete
f2dc9f1dc2 Add missing license header
Change-Id: I0a1c453ff87beb7c900c6b1e76432bcd908a999d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-05 08:31:23 +01:00
Paul Olav Tvete
97fcf3bc98 Introducing the Qt Android port
Based on the Necessitas project by Bogdan Vatra.
Contributors to the Qt5 project:

BogDan Vatra <bogdan@kde.org>
Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
hjk <hjk121@nokiamail.com>
Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Paul Olav Tvete <paul.tvete@digia.com>
Robin Burchell <robin+qt@viroteck.net>
Samuel Rødal <samuel.rodal@digia.com>
Yoann Lopes <yoann.lopes@digia.com>

The full history of the Qt5 port can be found in refs/old-heads/android,
SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d

Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-05 08:31:23 +01:00
David Faure
1b582d64eb Long live QLockFile
Locking between processes, implemented with open(O_EXCL) on Unix
and CreateFile(CREATE_NEW) on Windows.

Supports detecting stale lock files and deleting them.
Advisory locking is used to prevent deletion of files that are still in use.

Change-Id: Id00ee2a4e77a29483d869037c7047c59cb909339
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 06:26:33 +01:00
Alberto Mardegan
e3f36e7290 Make tst_qwidget more stable
This change fixes a failure of tst_qwidget under XFCE (Ubuntu 13.04).

Change-Id: Ic63e85a97ac6e44ce8c281a80ef4e83feecd9185
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-03-04 14:54:57 +01:00
Thiago Macieira
ccdec0b7a6 Remove excess brace added by accident
Added in 53dc49ffc8.

io.pro:44: Excess closing brace.

Change-Id: Ia3810a5a2668d96ab4604831e8ca5b49c7562956
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2013-03-04 14:54:57 +01:00
J-P Nurmi
14dab5b2d7 Add QProxyStyle(QString key) constructor for convenience
The QStyle implementations are becoming private, so the following
slightly verbose pattern seems to be now repeated a lot:

    new QProxyStyle(QStyleFactory::create("windows"))

This change adds an alternative, more convenient constructor for
this particular use case:

    new QProxyStyle("windows")

Change-Id: I97ded597a0fd3225a6354ebea0abb367237430af
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-03-04 14:54:57 +01:00
Olivier Goffart
7e5d1c1c2f moc: Support the '$' character as an identifier
Both gcc and clang allow the use of '$' in their identifiers as an
extension. moc should not throw a parse error if there is one in the
file. Instead, consider '$' as valid in identifiers.

Task-number: QTBUG-22720
Change-Id: I8be3a52429c0db5b7e8308b8f4fe475d3d3994bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-02 12:58:18 +01:00
Olivier Goffart
b0e58a9008 Fix compilation of moc generated file with MEMBER properties
If the object has only MEMBER properties, without any other property
specifying READ, the generated will fail to compile with this error:

tst_moc.moc: In member function ‘virtual int ClassWithOneMember::qt_metacall(QMetaObject::Call, int, void**)’:
tst_moc.moc:3810:42: error: ‘_v’ was not declared in this scope

That's because the '_v' is only declared if 'needTempVarForGet' is set,
and it should be set when we have a MEMBER property.

Change-Id: I829fad3faf69654b5a3fd540857df19f4a9449d4
Reviewed-by: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-02 12:58:18 +01:00
Peter Hartmann
b20d15b58b QUrl: update top level domains that may contain non-ASCII characters
Most notably, .com and .net now may contain non-ASCII characters.
list has been generated from
http://www.mozilla.org/projects/security/tld-idn-policy-list.html

Change-Id: Idc3191dc782bc4173ccb19b4bc81f4f061ca7999
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-02 10:13:27 +01:00
Thorbjørn Martsum
d711f98bfb Clean up manual test to QGraphicsView (rubberband)
This cleans a bit up in the manual test by
a) Removing a weird reference alloration (and replace . with ->)
b) rename for variable from v (which was also the view name) to n.
c) remove a big item in the scene rect that is irrelevant to the test

Change-Id: I49cb319bcc2f4bceef0c96ca86b571b0240a9a92
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-03-01 22:10:25 +01:00
David Faure
f2e8a81227 QMimeDatabase: pass MatchMode down, to fix MatchContent.
Task-number: QTBUG-29702
Change-Id: I2f1538adbf8e7a5edfc4276585bf4ef04ce69874
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-01 13:05:11 +01:00
Jędrzej Nowacki
c474f40452 Add QDBusReply::error() const.
The accessor was missing.

Task-number: QTBUG-29917
Change-Id: Ie6759a1120bc9ed6550c271df35f276e15b4eb79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-01 09:39:23 +01:00
Jędrzej Nowacki
0effb75153 Enable QGlobalStatic autotest.
Change-Id: Icda82dacbc749247153df1edb75629b959030ee9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-28 23:43:50 +01:00
Thiago Macieira
50d3a2917e Fix Q_GLOBAL_STATIC support for exceptions
The problem was that the HolderBase destructor was getting called after
the contained type's constructor threw an exception, as is required by
RAII semantics (the base was fully initialized, so it had to be
destroyed). That was required because we want to return a non-null
pointer from operator() during destruction and return null after
destruction, to keep compatibility with Qt 4.

The solution is to only set the guard to Destroyed only if it is already
at value Initialized. This way, if the HolderBase destructor is run as
part of the stack unwinding, it knows that the construction did not
complete.

Change-Id: I9849b43ed7112bf9e70861b48a56a924c286617e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-28 23:43:46 +01:00
Olivier Goffart
ab59a7ef09 Add private API to connect to slots in QObjectPrivate
Change-Id: I16ffbf91ff4c6e9fca6fe7984800d2c24e70701b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-28 19:22:05 +01:00
Olivier Goffart
123ce761c0 QT_MESSAGE_OUTPUT: add support for condition depending on the type
The motivation is to enable coloration the way KDE currently does.
It can now  be achieved with a QT_MESSAGE_OUTPUT set to
"%{appname}(%{category}) \033[31m%{if-debug}\033[34m%{endif}%{function}\033[0m: %{message}"

I was thinking about supporting directly color using something like
%{begin-category-color} that would be smart and detect if we are running
on a terminal, but it would be less flexible in the way the colors van
be configured.

Changelog: QT_MESSAGE_OUTPUT can contain conditionals based on the type
of the message

Change-Id: Icd8de04734a94a3afcbf542a5b78b290a1914960
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-02-27 22:29:43 +01:00
Friedemann Kleint
7867f03f8a Stabilize tst_qprogressbar.
- Wait for shown to ensure events are processed.
- Move away from screen corners/potential task bar areas.

Change-Id: I2c3aa9b675c6b33ca0da67ee99cc6f76c502098a
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-27 20:17:19 +01:00
Paul Olav Tvete
1199136bd3 Fix test script
This script was completely broken, and seems to have been abandoned.

Change-Id: If307f001237609ccb054c0a469213290294161c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 18:02:22 +01:00
David Faure
e433553c1b tst_qfile: remove unused variable
Change-Id: I3c827b8a372158815cf234a548a85cf6165c189e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 16:00:08 +01:00
Friedemann Kleint
cd1e245877 QStandardPaths: Use forward slash consistently.
Task-number: QTBUG-29249

Change-Id: I027f9ae18544dc47e1378214244487c8a5ae704c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 09:24:33 +01:00
Samuel Rødal
b56caf5f4e Introduced QWindow::setMask() to expose existing platform functionality.
Task-number: QTBUG-28555
Change-Id: I2c649b6d9e9dc69be246cb7658b3edbe9682b1bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-27 09:11:18 +01:00
Thiago Macieira
cafb02911a Make sure that the reference count for plugins is kept correctly
For systems where the Unix signature checker isn't enabled (read: Mac
and Windows), QPluginLoader must actually load the plugin to query for
the metadata. On Mac it even tried to keep the library loaded to avoid
unloading and reloading again when the user calls load().

However, that plus the fact that it was calling load_sys() (on Mac)
meant that it would bypass the reference count checking. And on all
Unix, if a library-that-wasnt-a-plugin was already loaded by way of a
QLibrary, it would have an effect of unloading said library.

So remove the "caching" of the library. We should instead invest time to
write a proper Mach-O binary decoder.

Task-number: QTBUG-29776
Change-Id: Iebbddabe60047aafedeced21f26a170f59656757
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-02-27 07:09:18 +01:00
Thiago Macieira
790fe22c52 Autotest: check that the plugin was actually unloaded in QPluginLoader
Change-Id: I66d26da4e86add244d37ff670ad79ff2aff17ca1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-02-27 07:09:13 +01:00
Konstantin Ritt
996db96d5e Fix QString::toUcs4() returns incorrectly resized QVector
...when the string contains surrogate code points.

Task-number: QTBUG-25536

Change-Id: I07251fee641c14f33175678768ddbe551dbe2bb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 03:13:30 +01:00
Friedemann Kleint
176383f3ec tst_qfileinfo: Fix invalid preprocessor directive.
Introduced by 5ec342fefd .

Change-Id: I28f9e093567ef1abf3898146e7183a90888262ad
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 19:24:36 +01:00
Thorbjørn Lund Martsum
717a0a9d04 QGraphicsView - emit signal when rubber band changes.
The rubberBandRect function is nice to have, but this patch
makes it easier to track the rubber band by emiting a signal
on change.

That makes it easier (and less clumsy/hacky) to show information
related to the rubber band.

Change-Id: If65eb85d743a1804be3fdb823a821423411e9745
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 13:31:45 +01:00
Thorbjørn Lund Martsum
c56f73cc1e QGraphicsView - add function to get RubberBand rect
In many situations it is handy to know the rubberband rect.
There are many situations where we want to show something
related to the rubberband.

Regardless how that is done the rubberband area is needed.
(Not having this is a flaw that can force people to do make
a customized rubberband just to get this information)

Change-Id: Ia854db4c0022b6a97b150af2b4bb78fd5e974991
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 13:31:45 +01:00
Stephen Kelly
f136701bc5 Use the base implementation of QAbstractItemModel::sibling in QSIM.
QStandardItemModel doesn't really benefit from a reimplementation of
sibling, and the current implementation is buggy.

Task-number: 29540
Change-Id: Icf8dca29b6e1394a378db5bf6abd884f2d7fd9b9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-26 00:03:26 +01:00
Fabian Bumberger
faefc09e93 Fix qfile autotest on qnx
This fixes the compilation of the qfile autotest on qnx.

Change-Id: Iab099e8b754a4341152e338ff6e3d22a83c625e3
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2013-02-25 17:34:40 +01:00
Shawn Rutledge
fa5bd4ed98 Added transient window manual test
Change-Id: I05e657488bb05e1aa6343270946512c8793f1e68
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-25 15:00:24 +01:00
Shawn Rutledge
153d613353 Transient QWindows centered; default-constructed geometry
Default-constructed geometry does not mean put the window at 0,0,
and it does not mean center the window on the screen: it means
let the window manager position the window.  If the window is
explicitly positioned at 0,0 though, that is a higher priority
than the transient hint; without this change, the transientFor property
had no effect.  On X11, transient means use center "gravity" to
make the transient window exactly centered.  But the user can still
override the geometry of a transient window, as with any window.
On OSX and Windows, neither transient window functionality nor smart
initial positioning are provided, so a window with no position set
will be centered on the screen, and a transient window will be put
at the center of its transientParent.

Change-Id: I4f5e37480eef5d105e45ffd60362a57f13ec55f5
Task-number: QTBUG-26903
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-24 20:41:05 +01:00
Keith Gardner
3b5600f6ee QStringRef: Added toInt(), toUInt(), etc... functions to QStringRef.
Added the following functions to QStringRef: toShort, toUShort, toInt,
toUInt, toLong, toULong, toLongLong, toULongLong, toFloat, and toDouble.
These functions use the corresponding functions found in QLocale.
Updated tst_qstringref.cpp to exercise the new functionality.

Change-Id: I38668a0cc7da0c101a62613fd16cb5a98286617f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-22 21:23:33 +01:00
Stephen Kelly
7477d50fce Populate the cmake variables only one time.
Since we're only including the Extras file one time, invoking set() for
the include dirs again will overwrite the addition of include dirs in
the extras file.

We only need to populate these variables if not set anyway, so do that.

Change-Id: I04dad0674778e79c8c12c18231b8ce6c92edf881
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-21 22:41:05 +01:00
Olivier Goffart
b05f19f232 moc: Fix infinite recursion in macro substitution
When performing macro argument substitution, one should keep the set of
macro to exclude, else we can enter an infinite recursion.

Testcase:
 #define M1(A) A
 #define M2 M1(M2)

Task-number: QTBUG-29759
Change-Id: I564bbfed65e1c8599592eaf12c6d67285d2fd9ce
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-02-21 16:55:41 +01:00
Olivier Goffart
03b2512598 Fix QMetaType of const references
This fixes QMetaType detection of const reference arguments in signals
while connecting using the new syntax and Qt::QueuedConnection

const references should have the same QMetaType as non references.
That means we need to remove the const reference while getting the
QMetaType.

Change-Id: I9b2688da7fb9ae985aec0d8fa62a1165357ffe71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-02-21 14:54:00 +01:00
Albert Astals Cid
70f6652ebd Forward the 3rd parameter of dataChanged
Change-Id: I94f893bf65cd150c3cb1099c91cb13882bcca79a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-21 00:58:32 +01:00
Frederik Gladhorn
dcb710dd87 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	mkspecs/features/unix/separate_debug_info.prf
	src/gui/kernel/qwindow_p.h
	src/plugins/platforms/cocoa/qcocoacursor.mm
	tests/auto/tools/moc/tst_moc.cpp

Change-Id: Ieb57834c00f961a747ffe51e6eb9fc9612cebccf
2013-02-20 22:08:29 +01:00
Jędrzej Nowacki
dacc222d5a Fix QVector detaching in one thread while another destroys it.
The patch adds handling for a case when a QVector is shared between two
threads. In such scenario detaching in one thread could collide with
destruction in the other one, causing a memory leak or assert in debug
mode.

Task-number: QTBUG-29134
Change-Id: Idbff250d9cfc6cf83174954ea91dbf41f8ea4aa4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-20 15:22:55 +01:00
Jędrzej Nowacki
d3a4230757 Make QVector instances counter thread safe
Change-Id: I7c7aa1eb0f8e91c43023882a3734e908be4ba4fe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-20 15:22:55 +01:00
Friedemann Kleint
4606ea5395 QProgressBar: Use localized numbers and percent sign.
Task-number: QTBUG-28751

Change-Id: I56aca3e0ee9c579297110c69d2d832c7a57f1ae7
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Karim Pinter <karim.pinter@digia.com>
2013-02-20 08:15:26 +01:00
Tor Arne Vestbø
443380d97f Don't run qmake test that requires macx makespec on non Mac OS platforms
And update test to use the clang makespec now that it's the default.

Change-Id: Ifdd34c4220ad76f60b91fd6ef39d189f0f6525f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-20 00:46:50 +01:00
Richard Moore
5ebc8d3663 Add an encrypted() signal to QNetworkAccessManager and QNetworkReply.
Add an encrypted signal to QNAM and QNetworkReply to allow applications
to perform additional checks on the certificate chain beyond those done
as part of the standard SSL validation. This allows things like
certificate change notification to be implemented for QNAM as they can
be for QSSLSocket currently.

Change-Id: I693e3e6fec8b7040379b7e7f1f819550e6b2617f
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-19 21:37:32 +01:00
Richard Moore
7898080ca7 Add support for intermediate certificates to server sockets.
Add intermediate certificates to our server sockets, and to our client
certs.

Change-Id: Ib5aa575473f9e84f337bebe35099506dd7d7e2ba
Task-Number: QTBUG-19825
Task-Number: QTBUG-13281
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-19 21:37:24 +01:00
Richard Moore
4a07519877 Store the local certificate in a QList.
Instead of storing a single QSslCertificate for a the local cert, store
a list of them. This will allow us to handle server sockets that use a
certificate that is not issued directly from the CA root in future.

Change-Id: I9a36b9a99daa9c0bdd17f61b4ce1a7da746f2e96
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-19 21:37:14 +01:00
Jan Arve Saether
18f9eb797b QStackedLayout: Fix crash when focus widget is destroyed in hide()
We also have to make sure that when moving back to a page
that has a focusWidget(), the focus should go to the focusWidget()

Task-number: QTBUG-18242

Change-Id: Ibfa7d6361c1a456480b2f1584a88ef4c4f405709
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 21:07:14 +01:00
Jan Arve Saether
64106705e7 Clean whitespace
Change-Id: Iec1950a0f4053cd71633162f0cb50efc9d4d493f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 21:06:53 +01:00
Tor Arne Vestbø
eb09f9b82c moc: Error out when detecting unterminated macro usage
Exhausting the symbol list while looking for the
final right parenthesis means it is missing.

Task-number: QTBUG-29308
Change-Id: Iccf5897b0f5eb719699fd12d6c8e4a16ff189d9b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-19 20:51:44 +01:00
Oliver Wolff
5dbd42a62e Check for network module when building according benchmarks
Change-Id: I5e4cb3ef6fdb5de772d13029c11170d0f0eb3ee5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:21:08 +01:00
Oliver Wolff
bf04283b4e Removed unneeded printsupport dependency from qpainter autotest
Change-Id: I906726a3d77572b9e054adbc68c4755dd663ad87
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:21:03 +01:00
Oliver Wolff
1a6bea1ceb Check for printsupport module when building according auto tests
Change-Id: I9bade7b31c75331190960cb14dee6840e3582c50
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:20:58 +01:00
Oliver Wolff
53dc49ffc8 Check for network module when building according auto tests
Change-Id: I68013bf8e07be8d202b3253f997d4f4db05335a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:20:53 +01:00
Peter Hartmann
165926c3ae SSL session sharing auto test: Retrieve smaller file for testing
The "mediumfile" is actually 9.6 MB large, and makes the test slow and
even fail on mobile platforms.

Change-Id: I694d9d38e4d09c8e90a03c1141320fe2a757fdd9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-19 10:35:06 +01:00
Pasi Petäjäjärvi
5ec342fefd Fix QFileInfo autotest for VxWorks.
No users/groups/symlinks on VxWorks.

Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00