Commit Graph

3497 Commits

Author SHA1 Message Date
Frederik Gladhorn
e432d53883 Only compile SSL tests when openssl is available.
Change-Id: I79fc705f30fb84e86bd7d674d90fbbe2d1a124ba
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-13 23:56:41 +01:00
Stephen Kelly
cc7239da8d Make it possible to use QPointer<const T>
This is possible with QWeakPointer, so allow it for migrating
code too.

In the process, replace the QPointerBase with a member variable for
simplicity. The functionality of the QPointerBase is replaced
by a TypeSelector template.

Change-Id: I3b4c77bdeda2b863cc33e84a3da8a25bae928c8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-13 15:15:56 +01:00
Stephen Kelly
0fb979fe23 Remove QPointerBase bic check.
QPointerBase is not public or exported and it is to be removed
in Qt 5.1.

Change-Id: I060c6b2ebcde8dedde85dc21404fc393150d452c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-13 15:06:53 +01:00
El Mehdi Fekari
640374d052 QLocale: add autotests for Japanese and Czech locales
Change-Id: Id4351ab49bfbdf91b65ccb5153c5d01f53acdf72
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-12 22:47:14 +01:00
Giuseppe D'Angelo
d57731b0d7 QRegularExpression: print a warning if (?J) is used in a pattern
(?J) inside a pattern string can be used to allow or disallow duplicated
capturing group names in the pattern string itself.
Although PCRE supports duplicated names, in Qt we don't yet.

Change-Id: I21cd0c41273cd7ef42870ced3a0fad6ba7035cbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 22:40:21 +01:00
Friedemann Kleint
9a74bbf34f Fix developer-build of qsslsocket_onDemandCertificates_member.
Do not include qsslsocket_p.h unless SSL is present.

Change-Id: I7e56b7758729907892d85f97d5a9d3ccaf7a3314
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-12 17:56:10 +01:00
Samuel Rødal
62d25e4d4f Fixed QPixmapCache associating path with wrong QPixmap.
QPixmap::load() would not detach, so multiple paths could get associated
with the same QPixmap, causing the wrong pixmap to be shown.

Task-number: QTBUG-29639
Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-02-12 15:21:57 +01:00
Samuel Rødal
23b11e792c Added QWindow::Visibility convenience API to QWindow.
This finally makes it possible to make windows fullscreen etc from
QML by doing "visibility: Window.FullScreen". I don't see any reason
from not having the API at the QWindow-level instead of at the
QQuickWindow-level since this way it can benefit other use cases too.

Change-Id: If27344306eb563bc2ccd83296a46b1f2862e2db1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 15:02:53 +01:00
Mark Brand
60c1f9f274 QSqlQuery tests: fix create table failures
Change-Id: Id20517cc68d03ac008650374fadd96cd6626d3fe
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 12:42:54 +01:00
Mark Brand
46b7c91c81 QSqlQuery tests: fix bool test for postgresql
Change-Id: I60634f89841cbc81058588e435c6482c6c0efed6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:56:00 +01:00
Mark Brand
f01caaf64a QSqlQuery tests: fix mysql problems
Change-Id: I82f4e6c8801c7a936b80ad72c229f915e6d2a4de
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:54:51 +01:00
Mitch Curtis
4aa86461eb Ensure QDateTime can handle QDate's full range of julian dates.
Currently, using QDate::maxJd() in tests will fail. This patch changes
some ints to qint64s to prevent overflows where necessary.

Change-Id: I61ebf8f233411a7544689fd5bfa9c3abee54e933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 07:29:36 +01:00
Mitch Curtis
86115848b5 Correctly detect HTML 5 charset attribute in QTextCodec::codecForHtml()
QTextCodec::codecForHtml currently fails to detect the charset for this
HTML:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1">
    <title>Test</title>
    </head>

This patch makes the detection of charsets more flexible, allowing for
the use of the HTML 5 charset attribute as well more terminator characters
("'", and ">").

I also added a *_data function for the unit tests.

Task-number: QTBUG-5451

Change-Id: I69fe4a04582f0d845cbbe9140a86a950fb7dc861
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2013-02-12 01:31:26 +01:00
Friedemann Kleint
d180560e14 Fix QWindow::setFramePosition() to keep the size.
Change-Id: I14551e0d0573c2e8d86d76eadab4df9f3c8ed5e4
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 15:17:07 +01:00
Sze Howe Koh
26817211d2 Fix module name format in displayed code
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtDBus       -> Qt D-Bus
QtMultimedia -> Qt Multimedia
QtWidgets    -> Qt Widgets

Change-Id: I96a1523b37e294b10b203782074943c6ec55e34a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-11 01:43:21 +01:00
David Faure
b61cff8d6e qprocess autotests don't need QtGui
(this isn't true of -all- corelib/ autotests though, e.g. tst_qdatastream
uses QBitmap)

Change-Id: I314fda5d85d45cb5eece8da74156989b83cf0299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 18:44:41 +01:00
Richard Moore
20bde28448 Add support for SHA3 to QCryptographicHash.
This commit adds SHA3 support to QCryptographicHash. Two implementations
are provided, one optimised for 32 bit and one for 64 bits. The code has
been written to make it easy to add further implementations, for example
ones using NEON instructions on ARM.

Change-Id: I3be9c45bbd4fcc2771d697e7f7ae74e48a831e8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-09 15:58:09 +01:00
Peter Hartmann
916f0ff663 QUrl effective TLDs: update table and split into chunks of 64K
The table is there to know which domains are allowed to set cookies
and which are not. There are more than 2000 new entries since the
list has last been generated.
The split to 64K chunks was made because this is the hard limit for
strings in Visual Studio.

Change-Id: I511aec062af673555e9a69442c055f75bdcd1606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 10:12:44 +01:00
Mark Brand
93ed02e3b1 fix QSqlTableModel:revert() for OnFieldChange
revert() should operate in OnFieldChange edit strategy just as
submit() does. The reason in Qt 4 for excluding OnFieldChange
was that there was no opportunity to revert. The model was
refreshed, causing all changes to be lost. In Qt 5 a failed
edit remains in the cache until user action, which could be
to revert.

Change-Id: Ide021c4f83a53834b7ed81f2abfa3aa49317704d
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-09 01:39:54 +01:00
Samuel Rødal
bfa1584162 Added version() and setVersion() convenience API to QSurfaceFormat.
This lets you write code like format.version() >= qMakePair(3, 2), and
format.setVersion(4, 2) instead of format.setMajorVersion(4);
format.setMinorVersion(2);

Change-Id: Ib052091cc12865ea0d5db52e468ed6cd28f14840
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-08 20:00:00 +01:00
BogDan Vatra
934afb5c57 Fix loading of SSL certificate of DER files.
DER certificates should not be opened as text files, so we
only pass the QIODevice::Text flag when the format is
QSsl::Pem.

Change-Id: I4bad98023c397b967d5beeec0aaa6c414e06fd9c
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-08 17:37:51 +01:00
David Faure
574e5cf9c5 Add qunsetenv(), next to qputenv() and friends.
The existing tst_qgetputenv shows that qputenv with an empty value
doesn't lead to the same result on Windows and on Unix, and there was
no way to fully delete an env var on Unix (which is needed for some
env vars where not-set and empty are different, such as TZ,
see `man tzset`).
This is also why qglobal has qEnvironmentVariableIsSet() vs
qEnvironmentVariableIsEmpty(), on the getter side.

Qt4's ifdefs around unsetenv in qapplication_x11.cpp show that this is
needed within Qt too (although this particular startup notification code
has to be re-imported into Qt5 still).

Change-Id: I631c8cddbcf933d4b9008f11aefc59f5a3c7c866
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-07 01:22:40 +01:00
J-P Nurmi
ee317360e3 QColorDialog manual test: add initial color selection
Change-Id: I956404af728ef0d70977f6c69b1059b3656edd91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-07 01:22:40 +01:00
J-P Nurmi
0de3ea6554 Dialog testing tool: add missing enableDeleteModalDialogButton() calls
Change-Id: I012dc8c7c07fced69f8b7eda7a1686af1e11033f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-07 01:22:40 +01:00
Peter Hartmann
b5652df775 SSL: Implement session sharing and use it from QNetworkAccessManager
This improves performance since a network round trip can be avoided.

Change-Id: I1aaff7e48ef9638cb137de0f43942c3a4dd2884a
Initial-patch-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-06 23:24:44 +01:00
Jan Arve Saether
20204fe58b Do not crash if the child index is out of range.
Task-number: QTBUG-29077

Change-Id: I934101cdc121e9ef99de2e9eeaef154dd4cae0d8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-02-06 12:00:07 +01:00
Samuel Rødal
af84313c62 Fixed crash in image reader when reading certain BMP files.
If the high bit in a mask is set, for instance if the mask is
0xff000000, and we shift it to the right by 24 positions, since the mask
was not declared as unsigned we ended up with a mask value of
0xffffffff. We then add 1 to this value and divide by the result,
causing a division by zero crash.

The masks need to be declared unsigned to prevent sign bit extension
when shifting right.

Task-number: QTBUG-29194
Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-06 09:59:56 +01:00
Mark Brand
c3ae1c76f3 QSqlTableModel: support refreshing inserted rows with auto columns
Previously, selectRow() did not work after INSERTing a new row into a
table with an automatically populated column. It did not work because
the model did not know the primary values for the new row. Newly
inserted rows were therefore not refreshed in OnFieldChange and
OnRowChange edit strategies.

This change provides support for the typical simple case where a single
column is populated by the database and can be retrieved with
QSqlQuery::lastInsertId().

Task-Number: QTBUG-29102
Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Lukas Geyer <lgeyer@gmx.at>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-06 07:57:47 +01:00
Mark Brand
33c212b7d2 QSqlTableModel::setData(): fix non-change detection
Commit 10ff9de91b introduced the
optimization of ignoring non-changes, but it overshot the mark.
It neglected to consider that QVariant's equality operator does not
compare the null flag. It also failed to consider that setData() has
a useful side effect of setting the generated flag in a column of a
pending INSERT. This is important when the application actually wants
a NULL to be inserted into the column.

Task-number: QTBUG-29217
Change-Id: I1368f7acc21eebfeb5a8d23746fc38f6f30fd395
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-06 07:57:28 +01:00
Mark Brand
a694b9f8d2 fix QSqlTableModel::headerData() for empty query with inserted row
QSqlQueryModel::headerData() relied on virtual indexInQuery() to
detect whether the requested column at row 0 mapped to an index in
the query. This failed when row 0 was a pending insert managed by
QSqlTableModel, and therefore not in the query.

The only thing that matters here is the column.

Task-number: QTBUG-29108
Change-Id: I3e0ae85ba223e444781ec8033386d394bb44f0e8
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-06 07:57:13 +01:00
J-P Nurmi
5809471ac7 Manual test for QFontDialog
Change-Id: I2bcdd30990e88af45c8d4b2756fcdd48fc2a47d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-05 14:42:50 +01:00
Laszlo Papp
6c6960015e Add qDegreesToRadians and qRadiansToDegrees math functions
Change-Id: I6e9fd76f2d2860f46531a72349b46193b8eeaaa7
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-05 14:40:14 +01:00
Giuseppe D'Angelo
53f9e77140 QRegularExpression: add method for extracting the capturing group names
It may be useful to know which named capturing groups are defined
in an regular expression, and for each of them, what's the
corresponding index. This commit adds the needed method
to QRegularExpression.

Note that extracting the information doesn't happen while holding
the mutex in the private -- pcre_fullinfo just reads information
from the compiled pattern, so that's thread-safe.

Task-number: QTBUG-29079
Change-Id: I50c00ee860f06427c2e6ea10417d5c0733cc8303
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-05 13:46:25 +01:00
Marcel Krems
513971eecd QSqlError test: Fix isValid()-check for constructed QSqlError.
Change-Id: I4dc1f537226139ceca017cc36abadd2fba4ce35b
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-04 14:44:19 +01:00
Thorbjørn Lund Martsum
08a632ac1a QTreeView::expandToDepth - add missing emit of expanded and collapsed
Just like other functions this function should emit expanded and
collapsed.

A part of fixing
Task-number: QTBUG-8176

Change-Id: I6d801f61e6f0cb8836634cc52f0be2b610f6c728
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-02 08:10:55 +01:00
Sergio Ahumada
d011f64524 tests: Fix some more old references and links to Nokia
Task-number: QTBUG-28156
Change-Id: Ifb768b167203c901c5e42ce58c9aaf3db2739320
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-02-01 15:27:37 +01:00
Friedemann Kleint
40eaa72319 Do not run tst_qfilesystemmodel for MinGW.
Task-number: QTBUG-29403

Change-Id: I91c938d9a6510ae91e54cd53e2d9df0a56b68d50
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-02-01 09:18:42 +01:00
Friedemann Kleint
8138a09e05 Replace SRCDIR-define by QFINDTESTDATA in tst_moc.
Remove srcify() function, which was warned about as unused
on Windows.

Change-Id: I731d3b6f058d4246e39dcf9a137619ae5087d751
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 22:14:27 +01:00
Thorbjørn Lund Martsum
3260aec38e QTreeView - emit collapsed in collapseAll()
When we call call collapase we emit collapsed. Therefore it should
also be emitted on collapseAll()

This partly solves:
Task-number: QTBUG-8176

Change-Id: I20c1388fcbbb60d12debb4a0b3b0d9fed41e2563
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-31 13:12:40 +01:00
Thorbjørn Lund Martsum
80fa4b6c8e QTreeView - emit expanded on expandAll
When we call QTreeView::expand expanded is emitted.
For the same reason we should emit expanded on expandAll()

This partly solves:
Task-number: QTBUG-8176

Change-Id: Ie85e724eec50980c68f626ec47dec5c1e08cc085
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 13:12:32 +01:00
Morten Johan Sørvig
a9458a1755 Clean up logical dpi for QImage.
Revert to the pre highdpi-patch behaviour.

Before, both physical and logical DPI would be based
on the dpmx/dpmy variables, which could be changed
with setDotsPerMeter(). The highdpi patch introduced
separate ldpmx/ldpmy variables, which were not
changed by setDotsPerMeter().

This broke when loading images: setDotsPerMeter
would be called but the logical dpi would not change.

Remove ldpmx/ldpmy. Keep scaling the physical dpi
by the devicePixelRatio, which will be set to 1 by
default.

Task-number: QTBUG-29187
Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-31 10:39:38 +01:00
Nils Jeisecke
ffea8e98f7 Update roleNames in QAbstractProxyModel if sourceModel resets.
If a sourceModel resets, it's roleNames might have changed. This
is most likely the case if sourceModel itself is also a proxy model
of which the sourceModel was changed.

Task-number: QTBUG-28982
Change-Id: I102788f2c9bf97b4002b350673f9219e32e7a052
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-30 15:17:05 +01:00
Friedemann Kleint
07843b1b12 Fix warning about incorrect format in tst_qlocale.
type is unsigned long, should be %lu. Replace by stream.

Change-Id: Ib0346b54a4494910b4a5927d0de45840ca53fbda
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-30 13:00:02 +01:00
J-P Nurmi
b7eaf2efdf Manual test for QColorDialog
Change-Id: I4eab3ecfbe5b6e7d663fe92d49af173fd179ba6e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-30 10:47:05 +01:00
Stephen Kelly
8eae3a923a Provide the resetInternalData slot to cleanly reset data in proxy subclasses.
This was part of Qt 4.8, but Qt 5.0 was branched before that, so
the commit was lost.

Change-Id: I2a2ab3c75a0943ac734d588ebd74bc158dd6aaaf
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-30 10:44:32 +01:00
Sze Howe Koh
52a317092e Doc: Fix references to Qt Test
QtTestLib and QTestLib don't exist. The proper name is "QtTest" (code)
or "Qt Test" (English)

http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation
http://lists.qt-project.org/pipermail/interest/2012-December/005221.html

Files paths in qttestlib.qdocconf can't be changed easily however, as it
breaks things. So, they're left as they are.

Change-Id: Ifbc44ea858c453bedad8cd7723f847e67fc7a85a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-30 01:35:06 +01:00
Sergio Ahumada
f27b1b8795 test: Add bic data for linux-gcc-amd64
Task-number: QTQAINFRA-321
Change-Id: I449d51088d3e5bfc6f92f036d498a2ef6f7a46b2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-29 23:34:24 +01:00
Keith Gardner
159e17bc5b QStringRef: Added a trimmed() function.
Change-Id: I67c5d10f29f420e0aea95cf32b5d3c17c141899c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-29 22:28:17 +01:00
Peter Hartmann
7d757fc8fe QSslSocket tests: use qt-project.org as test server instd of codereview
Change-Id: I1f3a860bf1ab24c30001059b7bcbb19fba7cbc1d
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-29 13:00:38 +01:00
Frederik Gladhorn
3eb588078e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-29 11:33:35 +01:00
Stephen Kelly
d315e01218 Add the Qt::ItemNeverHasChildren flag and use it in QTreeView.
It can be used to determine whether expand() should really expand.

Change-Id: If79d8c295a4ca1356e60051682b227524a065126
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2013-01-29 09:28:43 +01:00
Friedemann Kleint
00ad768f10 Do not execute tst_qfilesystemmodel in parallel.
It may interfere with other file system tests.

Task-number: QTBUG-29014
Change-Id: I32dd7428993b0da1a2f70ec3e581050012a4ff32
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-29 07:30:45 +01:00
Thiago Macieira
edd2d9bd0a Make the null pointer dereference a volatile one
This is to ensure that the compiler won't optimise it out of existence.
Clang says it will do it:

testProcessCrash/main.cpp:50:5: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
    *(char*)0 = 0;
    ^~~~~~~~~

Change-Id: Iac7771046442f869e205e8789fffdd6443d58e67
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-29 01:47:01 +01:00
Sergio Ahumada
07e3bcdc10 Remove QT_{BEGIN,END}_HEADER macro usage
The macro was made empty in ba3dc5f3b5
and is no longer necessary or used.

Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html
Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-01-29 01:06:04 +01:00
Thiago Macieira
2a3d690a19 Forward-port tests on invalid port numbers from Qt 4
These tests were added to Qt 4 on commit
a17fc85b51a6bdcfa33dcff183d2b7efd667fb92

Task-number: QTBUG-28985
Change-Id: I3cf595384f14272197dcfb85943213c8f8ddeba0
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-28 21:07:41 +01:00
Sze Howe Koh
7bb43454b8 Fix minor typos in docs, printed messages & comments
Missing apostrophes

Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-28 18:12:41 +01:00
Peter Kümmel
70a9caf4de QVarLengthArray: add squeeze function
Add function to move back data to the stack.

Change-Id: Ic78a368459bce68629e29602e4eeae2e1afe398b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-28 16:52:40 +01:00
Friedemann Kleint
ff31462e73 Fix MinGW-Warnings in tst_qwinoverlappedionotifier.
Change-Id: I66c4e274c8b686d8a69476ad10751008f256e5a2
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:21 +01:00
Friedemann Kleint
2b3ed64951 Fix warning about redefinition of _WIN32_WINNT.
This is redefined by qt_windows.h

Change-Id: I6a8cb06c93c4055b166f1a214cba981d61680b9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:17 +01:00
Pasi Petäjäjärvi
f3fc2078b8 Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I917b769f967e9d71ec5025aae788f3e237b07aeb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
(cherry picked from commit 416e73a0fc)
2013-01-28 16:06:15 +01:00
Frederik Gladhorn
02ba93dd3d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
2013-01-28 11:10:29 +01:00
Friedemann Kleint
322055b9c9 tst_qfilesystemmodel: Avoid commonly used folders.
Use the test's temporary directory instead of
QDir::temp() and the documents folder
instead of QDir::home(). Split out unrelated test
from data-driven sort test.

Task-number: QTBUG-29014

Change-Id: I229f0b1c0f1e43b56d19ebd43fd7cc64a85b1222
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 09:41:39 +01:00
Friedemann Kleint
74c3a2f4f4 Fix warning about redefinition of M_PI in tst_qwmatrix.
Change-Id: Ib5e5fe0f087448b07adfa02984524cbb10c78395
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Friedemann Kleint
e334fb6493 Fix warning about unhandled enumeration values in tst_sqldriver.
Change-Id: I4e750982aab861abbbbabe980a663f8b118cdf54
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Mitch Curtis
5c5c9c26d2 Don't emit activated on clicking disabled itemview item.
A itemview item with its flags set to Qt::NoItemFlags is considered
disabled, and therefore should not cause the activated signal
to be emitted.

Task-number: QTBUG-20490
Change-Id: If824505c46f4fcadb9265ad6d1e9337f0cee32cf
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-26 21:22:22 +01:00
Jean-Paul Delimat
4bb5566632 Add toJson() formatting argument to QJsonDocument interface
The writer delegate used by QJsonDocument to produce a Json QByteArray
supports generating a human readable Json (with spaces and carriage
returns that reflect the Json structure) and a less human readable (no
spaces nor carriage returns) but more compact Json.

The method toJson() was extended with a format argument to support
the compact Json generation.

Task-number: QTBUG-28815
Change-Id: I8d13849ab9ab6ed7c645011260251dc14a8629d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Debao Zhang <hello@debao.me>
2013-01-26 03:09:27 +01:00
Laszlo Papp
e335fb7254 Add static dotProduct methods to the QPoint(F) classes
Change-Id: I66ac9433b74341a83569a60038ea2f7a025e81b1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-26 00:09:14 +01:00
Sze Howe Koh
63569a68d2 Doc: Fix module name format
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtCore         -> Qt Core
QtDBus         -> Qt D-Bus
QtDesigner     -> Qt Designer
QtGui          -> Qt GUI
QtImageFormats -> Qt Image Formats
QtNetwork      -> Qt Network
QtPrintSupport -> Qt Print Support
QtScript       -> Qt Script
QtSql          -> Qt SQL
QtSvg          -> Qt SVG
QtTest         -> Qt Test
QtWebKit       -> Qt WebKit
QtWidgets      -> Qt Widgets
QtXml          -> Qt XML

QtConcurrent   -> Qt Concurrent (partial)
QtQuick        -> Qt Quick      (partial)

Also, distinguish between "module" and "library"

Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-25 17:27:44 +01:00
Gunnar Sletta
64134181db Introducing QWidget::createWindowContainer()
A QWidget that can embed a QWindow. This can be used
to embed a QWindow/QOpenGLContext based window or a
full QQuickView.

Change-Id: I8415b5ae38562fc00b46150fa70b56fd9b19a80c
Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-25 14:11:07 +01:00
Frederik Gladhorn
9a5ab30d52 Improve QAccessibleApplication
Add more testing.
This uncovers that currently the QDesktopScreenWidget
shows up as child of the app. Fixed by not creating
QAccessibleInterfaces for QDesktopScreenWidget.

Also don't crash in indexOfChild when called with 0.

Change-Id: I9fb1e47e8f1f33189e6125f56f274a7b94ecd0dd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-25 11:58:23 +01:00
Pasi Petäjäjärvi
05b4000e01 Fixed checking HOME variable return value using isEmpty()
Return value of the QFile::decodeName(qgetenv("HOME")); is never null
if HOME environment variable is not set. So need to check the return
value using isEmpty() instead.

Task-number: QTBUG-28912
Change-Id: Ic57b1978d63e99b056cde35ca8cb9d2a07ff8ce8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-25 08:51:09 +01:00
Stephen Kelly
314e5ce5ee Add an umbrella cmake config file for Qt 5.
Change-Id: I96b6e96539a84a5919992afbaee757fa080b7ae0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-24 20:37:34 +01:00
Frederik Gladhorn
d0c360fd88 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-24 18:34:11 +01:00
Friedemann Kleint
9c6a91d07b Manual file dialog test: Add showModal().
Modal dialogs can now tested by just showing or running exec().
Remove connection of accept() from applySettings().

Change-Id: I5e3c0e6405ce5682f39d10a9c06b9d61be10ed3f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-24 16:28:16 +01:00
Frederik Gladhorn
627d9cbd3c Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

Change-Id: I4ca87d44129fa5c1d8541cd58b8d62bc69080688
2013-01-24 16:02:55 +01:00
Frederik Gladhorn
4730742f69 Stabilize tst_qabstractslider
When simulating hight load, this test failed 4 times out of 80 runs
on my machine.
With this patch I could no longer reproduce the failure.

Change-Id: I42748de0200b9094c8facf0e33f3794002ec1d01
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-24 15:16:19 +01:00
Tor Arne Vestbø
fed2d237b7 Extend lance-tests for text/statictext to check flipped/negative scale
Change-Id: I0504a6676f1acaa13ea1826e945d1faa51dd4e48
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-01-24 13:45:01 +01:00
Roman Pasechnik
45be71bf7d Added initializer list constructors for Qt associative containers.
Affected: QSet, QMap, QMultiMap, QHash, QMultiHash.

Task-number: QTBUG-25679
Change-Id: I01f3ecfbca805f4c053a75232188bd2a77fdb1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-24 11:38:54 +01:00
Andreas Aardal Hanssen
6476d6728e Make sure QGraphicsItem notifies changes to focusScopeItem.
A glitch in QGraphicsItem's logic made it update the focusScopeItem
pointer, but fail to notify the change to QDeclarativeItem through the
d_ptr->focusScopeItemChange() virtual function, hindering
QDeclarativeItem from emitting focusChanged() correctly for focus
scopes that do not have focus.

Two lines were moved, and a comment updated to reflect the reason
why the "return" is needed at this point. It's clear that the
calls to focusScopeItemChange() are unrelated to the return.

Task-number: QTBUG-29260
Change-Id: I12ba9161b16d34c3689401a92c86d2047989f7bd
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Alan Alpert <aalpert@rim.com>
2013-01-24 02:20:34 +01:00
Frederik Gladhorn
7df08a8b63 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-23 22:12:54 +01:00
Peter Hartmann
ce35c0db0d QSslConfiguration: toggle on demand loading of root certs properly
make sure we keep track of when we can load root certs and when we
cannot (we cannot when the developer set the certs explicitly). This is
implemented the same way for QSslSocket already, and needs to be
duplicated because we have 2 methods for setting CA certificates: one in
QSslSocket and one in QSslConfiguration.
In addition, adapt the auto test which checks whether setting a default
QSslConfiguration works: There is no way to set on demand loading
through the API, so it should be enabled by default.

Task-number: QTBUG-29103
Change-Id: I5146128aaa385dfcc0ad1e0ef81a92d9350ec5f2
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-23 19:36:07 +01:00
Allan Sandfeld Jensen
06e4b1cff4 QImage plugins should report supported mime types
Introduces the methods QImageReader::supportedMimeTypes and
QImageWriter::supportedMimeTypes which corresponds to the similar
supportedImageFormats methods, except they return lists of MIME types.

Task-number: QTBUG-28177
Change-Id: Ibb0e264a12eaf972a8bfd6bd891dcd9f89efd085
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-23 17:19:22 +01:00
Mehdi Fekari
786a6466e8 Add autotests for Indonisian and Catalan locales
Change-Id: Idbf14ee6f0cd83acfdc407408794aac7ad91c054
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-23 13:01:34 +01:00
Friedemann Kleint
3df0a41a7f Fix qstring-literals test for MinGW.
The test is compiled since QT_UNICODE_LITERAL is always defined
on Windows and ref.isStatic()) then fails since C++ 11 is not
enabled.

Task-number: QTBUG-29014
Change-Id: I357574a493c5191f1463e7ee5851d7db0e569315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-23 12:41:35 +01:00
Gunnar Sletta
2692db542e Implement focus handling of child windows for cocoa.
Change-Id: I1e05ef39aa67f8febdd27215d8ad05d26ece7caa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-01-23 12:41:35 +01:00
Frederik Gladhorn
586fabb3b5 Disable only accessibility bridge without dbus on linux
Keeping accessibility and only disabling the bridge will
enable more builds to work.

Warning about disabling accessibility disabled is needed
because in QStyle it is used to discover semantics about widgets
(if a toolbutton is in a toolbar).

Change-Id: Iae4e6ab63479743bdd70cba4b1954ec7cf3f88e9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-23 10:56:34 +01:00
Pasi Petäjäjärvi
416e73a0fc Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:59 +01:00
Thiago Macieira
3c6bb0ed8b Make the QtDBus object tree keep a count of active children
The new member variable activeChildren shall contain the number of
direct children that are active. This number differs from
children.count() because the vector may contain empty entries that
haven't been garbage-collected yet (obj == NULL and activeChildren ==
0).

When this count drops to zero, we know we can simply erase the vector of
children.

Change-Id: Ia20604d3fac852ea4a6e8862d934fbb936fa5e18
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:54:00 +01:00
Frederik Gladhorn
c608ec8254 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qsavefile_p.h
	src/corelib/tools/qregularexpression.cpp
	src/gui/util/qvalidator.cpp
	src/gui/util/qvalidator.h

Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
2013-01-22 18:40:13 +01:00
Thiago Macieira
f7eff72517 Add a new Q_GLOBAL_STATIC implementation
Unlike the previous implementation, this implementation is locked:
only one initialisation is ever run at the same time. It is
exception-safe, meaning that a throwing constructor will restart the
process.

Also, start using the thread-safe behaviour that GCC has offered for a
long time and C++11 requires.

Change-Id: I20db44f57d258923df64c0051358fd0d9a5ccd51
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-22 17:15:58 +01:00
Friedemann Kleint
326a5e0bca Fix testlib-selftest for MinGW.
Fix float format and exclude crashing sub-binary.

Task-number: QTBUG-29014
Change-Id: I404f971edeb128263122a194f23e2806d6fd3bd0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 17:15:58 +01:00
Tor Arne Vestbø
f5c6a5d06b Don't build lance as application bundle on Mac OS
Change-Id: I23732b4ec0dc45d9d3a2cc5f21dad2cb33af5830
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-22 14:56:47 +01:00
Frederik Gladhorn
15a3243556 Accessibility Linux: Make dbus registration async
Change-Id: I74043be04f4ee17089353304fdc007a7f22cdea0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-22 14:11:14 +01:00
David Faure
e01b163404 QTestLib: improve output when comparing lists fails.
Only QStringList was handled before, now any QList is handled.
A specialization for QStringList is still needed though, due to the way
template matching works.

Example with QList<int>. Before:
FAIL!  : tst_QTextCodec::threadSafety() Compared values are not the same
   Loc: [../tst_qtextcodec.cpp(2057)]

After:
FAIL!  : tst_QTextCodec::threadSafety() Compared lists differ at index 0.
   Actual   (res2.toList()): '0'
   Expected (mibList): '3'
   Loc: [../tst_qtextcodec.cpp(2057)]

Change-Id: If0fdec3236ddb78a679ee549aba569ef5571c395
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-22 13:29:33 +01:00
Friedemann Kleint
c73dc44606 Fix cleanup of temporary files in test of QFileInfo.
Change-Id: I0d21fc05a7d816acab5f7284f905bf971a5c04da
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-22 13:29:25 +01:00
Friedemann Kleint
267e2bbee4 MinGW: Disable tests in tst_qstring that use unsupported formats.
Task-number: QTBUG-29014

Change-Id: I7dc879c456da8dabe02a2bce07e8628d176ca9d1
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 13:29:14 +01:00
Jan Arve Saether
e17dddfd3b Make hierarchy of actions in menubars more consistent.
There is an assumption that the interface returned from iface->parent()
would have iface as one of its children (thus,
parent->indexOfChild(iface)
should always return an integer != -1, indicating that it is a child.

This is a good assumption, otherwise an hierarchy would be presented
differently depending on how it is traversed.

However, a QMenu created like this:
QMenu *menu = new QMenu("weird parent", mainWindow);
mainWindow->menuBar()->addMenu(menu);

will have a different ancestor sequence than a menu created like this:

mainWindow->menuBar()->addMenu("ok parent");

This is because it will walk up the QObject hierarchy.

This patch tries to deal with that by looking at which widgets the
action of the menu is associated with before determining which should
be the accessible parent.

Change-Id: I00dad8a94463f772d7b1f5d66fdb36b2e8d3aea2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-21 18:57:27 +01:00
Jan Arve Saether
fb4aef9c70 Accessibility: Test for do not crash if the column count is 0
This tests the fix submitted in bb5e11b56d

Task-number: QTBUG-28611

Change-Id: I7b15aa6b46be3607bd7079294d8e7d18bd507d1c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-21 15:28:28 +01:00
Friedemann Kleint
04773fe72e Reduce invocations of QFINDTESTDATA in tst_qfileinfo.
Introduce variables for the paths used in the test and
check in initTestCase().

Change-Id: Ie801266e30cd860e5bdf079c1182fe385f9598c7
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:15:01 +01:00
Friedemann Kleint
52e14e05fa Fix temporary file leak in tst_qfileinfo.
Change-Id: I0d679638d5a9564f612ae5e70717f164b74aefb0
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:14:53 +01:00
Gerhard Gappmeier
9bbebb9144 Add support for defining properties from member variables.
This associates properties with member variables and
avoids writing getter and setter methods manually.
The metaCall() method directly accesses the member variable,
so additional method calls can be avoided.
The metaCall() setter code also supports NOTIFY signals,
which means the according signal is emitted when the property
gets written.

Task-number: QTBUG-16852

Change-Id: I88a1f237ea53a1e9cf65fc9ef2e207718eb8b6c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-19 17:36:55 +01:00
Peter Hartmann
5bc5be22e8 QNetworkReply auto test: also test uploading data via HTTPS
... and not only HTTP.

Change-Id: I1190e07fdacd9bdfb218c8932e0e5e2c0c6fc6ab
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-18 17:58:48 +01:00
Friedemann Kleint
aacf4d0263 Fix a crash when minimizing a QQuickWindow.
Send empty expose event and flush queue when minimizing.

Task-number: QTBUG-28439
Task-number: QTBUG-26424

Change-Id: I2e921a86660f946ced7af735cdf197fb666e2934
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-18 15:42:59 +01:00
Friedemann Kleint
ced523af7a Fix crashes in tst_qthreadpool on Windows.
Qt 4.8 shows frequent crashes in runMultiple apparently caused
by the QMutex construction in the free functions by different
threads. Use a common QMutex class member instead.

Change-Id: I851d4e2d3637a7b4f404ed843f5360c10caa21f5
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-18 14:16:52 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
David Faure
00e0923e60 Output std error from qmake/make when the test fails.
This is intended to make it easier to understand what's happening when
this test is flaky during CI.

Change-Id: I13163c244cb99414d90b5f71c365a4ff2216bc83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:29 +01:00
David Faure
ff8362d65e QSaveFile autotest: restore permissions using RAII
So that the QTemporaryDir can happen even on error.

Change-Id: I728d49eac8bd65e1919fd314a95387949e134de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:22 +01:00
David Faure
2d5fe45379 QSaveFile: test the case of an existing, but readonly, target file.
Change-Id: I296d9c2598b8c72e2fd3e6ec80a615364b7eddeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:16 +01:00
David Faure
e993df8771 Add class QSaveFile.
This QIODevice uses a temporary file for writing, so that in case of
write errors, the writing operation is canceled, without losing any
existing file. It also avoids having a partially-written file visible
by other processes, at the final destination.

Change-Id: I9482df45751cb890b1b6f1382ec2eea3eb980627
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:11 +01:00
Peter Hartmann
170bf2a59a QDateTime auto test: stabilize currentDateTimeUtc2 test
... by trying more often to get dates close enough to each other.

Change-Id: I370f7cd61bbb84fbb77ea96ff9fd82c1a6f1f76a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-17 12:57:43 +01:00
Frederik Gladhorn
e3a10e15ff Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-16 23:51:11 +01:00
Friedemann Kleint
34572dadc6 Dialog testing tool: Control life cycle of non-modal file dialogs.
Keep the non-modal file dialog around and delete only on request,
such that one can simulate repeated invocations of show() on
the same dialog for testing native dialogs.

Change-Id: I80d0f1dfafbc02a31be192098121654a01025174
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-01-16 17:06:12 +01:00
Sergio Ahumada
eb87a0f409 tst_bic: Add linux-gcc-ia32 bic data for QtXml
Change-Id: I43670f41f41f465e5684362de64c355b68a1dbf7
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2013-01-16 08:25:28 +01:00
Frederik Gladhorn
7075e29199 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qstyleanimation.cpp

Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
2013-01-16 01:22:45 +01:00
Frederik Gladhorn
122ee7a367 Merge "Merge remote-tracking branch 'gerrit/release' into stable" into refs/staging/stable 2013-01-15 19:47:44 +01:00
Frederik Gladhorn
270a51b775 Merge remote-tracking branch 'gerrit/release' into stable
Change-Id: Ieb104d0e390218a063082c93bc9c7e412af2166d
2013-01-15 18:14:13 +01:00
Friedemann Kleint
d3dc0f2122 Fix renaming of files that differ only in case.
This currently fails on case-insensitive file
systems since the check for existence then triggered
and indicated "file already exists".

Check on the file id (inode or file id) whether
the target file is really a different file for a
case-changing rename.

Task-number: QTBUG-3570

Change-Id: I1b2d40850692e02142ee23d2c753428de00aedc6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 16:36:20 +01:00
Friedemann Kleint
bb5e11b56d Fix crash in tst_qaccessibility.
Release the table item below the table test instead of releasing
the text item twice.

Change-Id: I74d283d50a39b9a4570b73a8297ed3dbb2de2271
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-15 15:48:41 +01:00
David Faure
d147285d64 Add Q_COREAPP_STARTUP_FUNCTION macro.
This is necessary for initializing things in a library, which require
a QCoreApplication instance (unlike Q_CONSTRUCTOR_FUNCTION, which runs
before that). Example use cases: KCrash (segv handler), and KCheckAccelerators
(debugging tool triggered by magic key combination).

Change-Id: I5f4c4699dd4d21aea72b007989ba57467e86ed10
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 14:58:35 +01:00
Thiago Macieira
856f209fb6 Change all shmget calls to user-only memory
Drop the read and write permissions for group and other users in the
system.

Change-Id: I8fc753f09126651af3fb82df3049050f0b14e876
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-15 04:34:27 +01:00
David Faure
6b9545a980 QUrl: methods for converting QStringList <-> QList<QUrl>
This is a very common thing to do, e.g. in order to send urls via DBus.

Change-Id: I277902460ee1ad6780446e862e86b3c2eb8c5315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
327b2ba3b7 Add class QDebugStateSaver for writing QDebug operators correctly
Had to move QTextStreamPrivate to a private header, to be able to use
its new internal Params struct from qdebug.cpp

Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Ruslan Nigmatullin
d4adcfb8cc Added QMessageAuthenticationCode
QMessageAuthenticationCode is HMAC implementation based on
QCryptographicHash abilities. HMAC is often used in OAuth and similar
authentication protocols.

Change-Id: Ifc73947ad06c36a1b770315b7e89ba5c01c5e79e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Orgad Shaneh
b6963f109a QMenu: Fix nested popup when keyboard shortcut is used
Task-number: QTBUG-20403

Change-Id: I2a5fe00dd16e9dc1ec0d742a8f48083fc2954996
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-01-14 16:28:21 +01:00
Thiago Macieira
dc131e3a53 Make QDBusPendingReply behave like QDBusReply when dealing with errors
QDBusReply allows one to extract a QVariant and the type reply from an
error reply and getting a default-constructed value. This is useful when
a valid reply can never contain the default-constructed value (0, false,
empty strings, empty arrays, etc.), so it simplifies error checking.

More importantly, qdbusxml2cpp was changed a while ago from generating
QDBusReply to generating QDBusPendingReply, so we need to have the same
behavior.

Task-number: QTBUG-29046
Change-Id: Ia873b9fd4311c0d4e94f0ef623ba405c20bc0e8c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-14 13:03:50 +01:00
Thiago Macieira
60fc88a09c Resolve some race conditions on tst_QSharedMemory
This test runs fine almost all of the time on systems with 1
processor, which were the norm when the test was written and are still
the way that the Qt Continuous Integration system works as of
today. But it falls flatly on multi-processor systems.

The root of the problem is that QSystemSemaphore recreates the
semaphore if it disappears underneath it. However, the recreation
process is not thread-safe at all: if two threads race to recreate it,
weird things might happen. strace on Linux shows that a thread got
stuck trying to acquire the semaphore:

  <... nanosleep resumed> NULL) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  semget(0x51001388, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
  semget(0x51001388, 1, IPC_CREAT|0600) = 114786308
  semop(114786308, {{0, -1, SEM_UNDO}}, 1 <unfinished ...>

This problem does not happen if the creation and destruction of the
QSharedMemory (which uses QSystemSemaphore) does not race with other
threads or processes attaching and detaching. For the threads test
it's easy. For the processes, we use stdin and stdout as a
communication channel.

Change-Id: Ie11b135431d4abfc59234654848b67f622eb03c9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-14 11:35:17 +01:00
Giuseppe D'Angelo
9110d4f1ed QString::contains overload that returns the match results
This convenience overload allows one to write

    QRegularExpression re1, re2, ...;
    QRegularExpressionMatch match;
    QString subject;

    if (subject.contains(re1, &match)) {
        // ...
    } else if (subject.contains(re2, &match)) {
        // ...
    } // ..

One can then inspect the results of a successful match in each block
(as well as extracting the captured substrings, etc.).

Change-Id: I0fb8be8b577656e8db994198f8105c26c4fe67b0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 10:26:59 +01:00
Giuseppe D'Angelo
65fba49d63 Introduce default ctors for QRegularExpressionMatch(Iterator)
This allows to put them in containers, and to enable subsequent
features for QString.

Change-Id: I3b3fe695ffe6930331ed9f670738376722e0fc36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 10:25:39 +01:00
Sergio Ahumada
4bd4c811f2 tst_bic: Add bic data for QtConcurrent and QtPrintSupport
Task-number: QTQAINFRA-321
Change-Id: I2699a13c3d8a7df9b12049e0337501a4e24d2d64
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2013-01-14 09:18:43 +01:00
José Millán Soto
08bc730b41 Implement QAccessibleActionInterface in QAccessibleTableCell
Implemented QAccessibleActionInterface in QAccessibleTableCell to allow
selecting and unselecting table cells, as there was no way of selecting
or deselecting a simple cell using accessible tools.

tst_qaccessibility.cpp was modified to test the new methods.

Change-Id: I7bdfe0b363a9813d4a7c62e96b6c924b163f2121
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-11 21:24:23 +01:00
Michael Brasser
f156e578d7 Ensure raster pixmap cache key is the same as that of pixmap.toImage()
This is done to support texture uploads in an image provider. It ensures
we can load the texture using QImage in the image provider, and when
it is later painted as a pixmap, the cacheKey will be identical
(assuming no format conversion was required).

Change-Id: I54229511ed91ce5430cc478af5aff0d96685a2da
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-11 21:24:23 +01:00
Shane Kearns
7e91b5a2bc Fix incorrectly disabled autotest
One of the IPv6 autotests was always disabled instead of being disabled
only when the system has no IPv6 support.

Change-Id: I34dffbeae6ba85a706bfeb0cc4750a4514b73a65
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-01-11 14:01:10 +01:00
Jędrzej Nowacki
63c68cadec Enable tst_qwidgetsvariant test
The test for a magic reason was not build by default.

Change-Id: I21c7fc959d76d6faac0091495f965f3da6d415b1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-11 12:02:21 +01:00
Mehdi Fekari
7ff47c7bfa Add an autotest for Canadian locale(dateFormat)
Change-Id: I68a91a418c418e113ecfe66769a7b3bc46de380c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-01-10 15:52:55 +01:00
Stephen Kelly
ccbff3fce5 Clean up some metatype declarations and registrations
Change-Id: I0826f6502cc45279f29f248f5f28f4fc9e6c8b4e
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-09 18:19:12 +01:00
Sergio Ahumada
63f24f6ba8 Merge branch 'stable' into dev
Change-Id: I7f0dab6bdb1f3cc1d3e6c30166ff6db9dfae37e9
2013-01-09 11:49:47 +01:00
Sergio Ahumada
bbb9abf7fb tst_bic: Remove 'timex' class from linux-gcc-{amd64,ia32}
'timex' is not a Qt class, so there is no need to check it.

Change-Id: Ic77b3518e5a7eaf2c2bc7dcd98d1f9aebf4b655d
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-01-09 09:11:46 +01:00
Oliver Wolff
083d2c8bb8 Removed hardcoded values from tst_qgraphicsview::scrollBarRanges
Instead of testing the "windows" and "motif" styles, that test should
actually test the scrollBarRanges for all available styles. To be able
to do that, the magic numbers 16 (width/height of scrollbars) and 4
(spacing for the faux motif style) were replaced and instead of setting
the explicit values in the data the "number of scrollbars/spacings to
add/remove" is saved in a struct and the value of these (depending
on the style) is obtained in the test run.

This change does not also cause the fusion style to also be tested but
also fixes this test for Windows 7 and 8 (Aero) where the scrollbar
width/height is not 16 but 17.

Task-number: QTBUG-28611
Task-number: QTBUG-29002
Change-Id: I5d103018fde81cee6e6e89cd414426768b2dc8e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-09 08:59:26 +01:00
Sergio Ahumada
d8a3bcc6c4 test: Add bic data for linux-gcc-ia32
Task-number: QTQAINFRA-321
Change-Id: I990f0c525fbd0b0b3818b0f7d86ed99438821baa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-08 19:50:18 +01:00
Friedemann Kleint
54fd35b134 Fix warnings about not being able to set Window geometry on Windows.
Fully decorated windows cannot be smaller than 160x30 (Large fonts).
Enlarge Windows or remove Window frame  to get rid of decorations.

Task-number: QTBUG-28611
Change-Id: Idb6ee94fb8d0760d5f97042b3084557f11e9fdf9
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-08 13:54:04 +01:00
Michael Brüning
41acb58f23 Add auto test for HTTP cache fix for QTBUG-28035.
Adds an auto test that verifies that the replies to POST and PUT
requests are not cached even though they contain a max-age header and
that subsequent GET requests are reloaded from the server.

Change-Id: I188ae1200cb5551e164722c0f479719be8d11bfb
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-01-08 11:13:27 +01:00
Jędrzej Nowacki
ae2359d49e Merge "Merge branch 'stable' into dev" into refs/staging/dev 2013-01-07 18:07:29 +01:00
Giuseppe D'Angelo
998899cf3a Introduce QRegularExpression::NoMatch match type
This match type doesn't do any match at all; it's only necessary to
properly introduce default constructors for QRegularExpressionMatch
and QRegularExpressionMatchIterator (since they return the match type
that created them).

Change-Id: Ibfe92459c7fdd23129cf3afe073cd443c461ddeb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-07 16:11:19 +01:00
Friedemann Kleint
bc5a2336ab Provide operators for QMargins.
Provide addition/subtraction for QMargins as well as
multiplication and division for int/qreal similar
to QPoint. Add unary minus.

Change-Id: If4eb831cfd610b34b5ca361619b1636031811d0a
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-01-07 16:11:19 +01:00
Friedemann Kleint
6ecc3e76e8 Add API dealing with QMargins to QRect.
- Addition of a QMargin to a QRect.
- Removal of a QMargin from a QRect.
- Remove implementation from Windows platform plugin.

Change-Id: Iae54bc13e94a7ece48853b1d3f3de2bfc154d2dd
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-01-07 16:11:19 +01:00
Giuseppe D'Angelo
41ec7c32ac Improve QRegularExpression autotests
Check that the regular expression, the match type and the match options
returned by QRegularExpression/QRegularExpressionIterator are the
same ones passed to match / globalMatch.

Change-Id: Ibd282379bb60b53d614b1d56a7e08b3d6c236da6
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-01-07 16:11:19 +01:00
Frederik Gladhorn
cdf13ce286 Merge branch 'stable' into dev
Conflicts:
	tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp

Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47
2013-01-07 15:18:16 +01:00
Stephen Kelly
21d607c81a Automatically register method types in QSignalSpy.
Change-Id: I3655291dca6dbd3d8d09ee835b85983caa911b64
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-07 12:06:00 +01:00
Giuseppe D'Angelo
2d8910cbed Introduce QRegularExpressionValidator
QRegularExpression counterpart for QRegExpValidator.

Change-Id: Ib391e73dd49e32aeb9b48e6f2217b67a17a83a11
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-07 12:04:53 +01:00
Sergio Ahumada
a8321f21fb Add bic data for tst_bic
- Add initial set of amd64 data
 - Add QtWidgets to global.cfg

Task-number: QTQAINFRA-321
Change-Id: I9bffaa00ac01976546629988ac69965383eb2efd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-06 19:16:02 +01:00