Commit Graph

4690 Commits

Author SHA1 Message Date
Sze Howe Koh
b83dc929ec Complete QJsonValue::fromVariant()
- QVariant can store (U)Int, (U)LongLong, Float and Double numbers.
  Previously, QJsonValue::fromVariant() converted Floats into Strings
  while converting the others to Doubles.
- Add unit tests for QJsonValue::fromVariant()

[ChangeLog][QtCore][JSON] QJsonValue::fromVariant() will now convert
single-precision Floats into Doubles instead of Strings

Change-Id: I457adbe29c37ada611d1c6d711c42866d63d4024
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-06 12:21:14 +01:00
Tor Arne Vestbø
9d79c3458c Disable the qmetatype test on Clang + ARM, it's causing OOM during build
And takes a very long time to build if it doesn't run out of memory.

Task-number: QTBUG-37237
Change-Id: I8c7fae4d2d99ad59c6d6306da2df554a05955446
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-04 15:59:05 +01:00
Andy Shaw
f07841bc7c Revert path() behavior to not expand a current path on a drive
In the original change - cfb44c6528 - when
querying for the path of a file that did not contain a slash after the
drive indicator it would get the current path and return that as the path
that the file resided on.

However this meant that it would take the current path at that time which
may not be the actual path that was expected. So it was decided that
it should revert back to the original behavior which was to just return
the drive letter followed by the colon which would thus indicate still
that it represented whatever the current path was on that drive.

Change-Id: Ic57ae9227882a66e9a4c4d6537d7f2cae829165a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-03-04 15:59:05 +01:00
Laszlo Agocs
4b2f35d04c Dynamic GL: remove exporting symbols
Remove the opengl proxy for now. Later it will either be moved into
a separate library or replaced by a QOpenGLFunctions-based approach.

This means that the -opengl dynamic configuration is not usable
for the time being. The rest of the enablers remain in place.

The convenience function QOpenGLFunctions::isES() is now moved to
QOpenGLContext and is changed to check the renderable type. This is
extremely useful since besides supporting dynamic GL it solves also
the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES
path when creating an ES-compatible context with a desktop OpenGL
implementation).

Task-number: QTBUG-36483
Task-number: QTBUG-37172
Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-03-04 15:59:05 +01:00
Sze Howe Koh
fe2ce05d23 Remove duplicated tests
tst_QtJson::testValueSimple() tested bool and double values twice

Change-Id: Ie6e58aab729c6ee20cb53d3b85746a05f7571f5e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-04 15:59:05 +01:00
Chris Colbert
6060dab13a Fix issue where revealed widget children do not receive paint event.
When a child of a widget is spontaneously revealed due to a call to
the parent 'resize' method, the child will not receive a paint event
if it has the WA_StaticContents and WA_OpaquePaintEvent flags set.

This is caused by the backing store being pre-emptively resized by the
call to setGeometry_sys, which causes QWidgetBackingStore::sync to skip
the block which handles the static contents.

There doesn't appear to be any reason to preemptively resize the backing
store, since it is always resized as-needed during the the 'sync' method.
This change-set removes the code which preemptively resizes the backing
store.

Task-number: QTBUG-35282
Change-Id: Ie9942854ca5322dfe0f98ed8100810161576be80
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-04 15:59:05 +01:00
Friedemann Kleint
b22ef59663 Remove use of templates in tst_qatomicinteger.
MSVC 2008 is confused by TypeInStruct being a template, resulting in

\tst_qatomicinteger.cpp(189) : error C2027: use of undefined type 'QStaticAssertFailure<Test>'
        with
        [
            Test=false
        ]

for int (and thus for all unsupported types). This appears to be a real
Heisenbug-nature compiler bug as it can also be fixed by adding
qDebug() << Q_ALIGNOF(TypeInStruct<T>)
before the static assert.

Task-number: QTBUG-37195

Change-Id: Ib2b60f3c1ffeb0b8bdeb1fb0c659655ce4ab10d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-04 15:59:05 +01:00
Friedemann Kleint
e531b46bed Turn off compiler optimization in tst_qtendian for MSVC2008.
This causes frequent compiler errors on Windows CE.

tests\auto\corelib\global\qtendian\tst_qtendian.cpp(140) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'd:\orcas\compiler\utc\src\P2\main.c[0xCCCCCCCC:0xCCCCCCCC]', line 243)

Task-number: QTBUG-37194

Change-Id: I2adbc1e3b1896fbe86780aa26a15e918333a09f2
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-04 11:29:30 +01:00
Sergio Ahumada
7e872de76e Fix some typos
Change-Id: I7dbe938bff5ac3ab50a0197f94bdb2f6c22fbd16
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-03-03 18:24:29 +01:00
Sergio Ahumada
e8ed514e35 tests: Remove superfluous gui additions to QT
by default QT contains both core and gui already

Change-Id: I6f5b551104e40a024468e7cb62e302134e9472ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-28 17:59:29 +01:00
Sergio Ahumada
e5870b61c6 tst_qnumeric: Mark some tests as XFAIL on BlackBerry 10
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.

 - floatDistance(denormal)
 - floatDistance_double(denormal)

Task-number: QTBUG-37094
Change-Id: I79dbc78da6e9bef8466264fd2cab4af0ee8b868f
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-28 07:46:31 +01:00
Sergio Ahumada
82e699cab0 tst_qtjson: Mark some test as XFAIL on BlackBerry 10
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.

 - testNumbers_2()
 - toJsonLargeNumericValues()
 - parseNumbers()

Task-number: QTBUG-37066
Change-Id: Ifec95b936fb70253395dee4d1ca18e85870486a3
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-28 07:46:31 +01:00
Giuseppe D'Angelo
c453571d75 CSS parser: fix the pseudo-classes array length
The pseudoclass array is declared with length "NumPseudos - 1",
but the declaration has actually 44 elements, not 45.

This caused a zero-initialized last element to be silently appended
to the array. The zero-initialized element broke the sorting
of the array, which in turn broke std::lower_bound usage
(although of course the problem was there from before switching
to the standard library algorithms).

Task-number: QTBUG-36933
Change-Id: I8a02891fc36761b6ae72d15a0a8d6c6a96813947
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-02-26 14:18:48 +01:00
Allan Sandfeld Jensen
b1a882f178 Fix drawCachedGlyphs on RGBA8888
drawCachedGlyphs draws with the wrong color on RGBA8888. The issue
is that the draw routines bitmapblit_quint32 and alphamapblit_quint32
while safe to use on rgba formats, needs to have the input color
converted.

This patch adds small wrapper functions for bitmapblit and alphamapblit
that converts the formats. Two tests are extended to ensure we have
test coverage.

Change-Id: I5f99f3795eba46a69d4df5b167e6099024e9a060
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-26 14:18:21 +01:00
Kai Koehne
f3ed93e486 Logging: Change 'rules' section name to 'Rules'
This is more consistent with e.g. qt.conf, where section names also
start with an upper case character.

Change-Id: I9ddaf72baeb9334d081807412512242d5d46cbbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-26 12:58:00 +01:00
John Layt
aab29d546c QPrinter - Add more tests
Add more missing tests.

Change-Id: I801c5c67731075ccb3e62377c0eccc420e708365
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-02-26 12:58:00 +01:00
Eskil Abrahamsen Blomfeldt
e1fd82981c Revert "Fix application font removal when using FontConfig"
This reverts commit a4ff400e25.
The patch caused a regression for bold fonts which is currently
blocking the alpha of Qt 5.3, so lets revert it and try
resubmitting a fixed version later to avoid delaying any release.

Task-number: QTBUG-36929
Change-Id: I8d474b09b2270eb2f861853e60605429be08e2d9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-02-25 21:51:07 +01:00
Sergio Ahumada
5e39b7ad1e tst_spdy: Check network test server
There is no need to even try to run the tests if the network test
server is not present.

Add a validation in initTestCase() since all test functions depend
on the network test server.

Change-Id: I8eca376a718ab5b6e1cc2c57f2e045dd0b58f52b
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-25 16:47:22 +01:00
Sergio Ahumada
699ba50744 QtNetwork tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: If1cc5fafddc41ed19dd818caf294c69cd4969216
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-25 16:47:13 +01:00
Sergio Ahumada
70ca6f5bba Remove qSort usages from core tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I355558fe6a51d00e9aa1f8b1221c6ec0c1e6bb77
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-22 09:51:14 +01:00
Thiago Macieira
1c63909ad8 Make sure all containers compile in strict-iterator mode
Unit-test this by making the QList, QVector, QHash and QMap unit tests
be duplicated under strict-iterator mode. There's no test for
QLinkedList.

The tst_Collections test does not compile under strict-iterator
mode. It generated over 15000 errors when I tried.

The strict iterators required a small change: the difference_type
typedef needs to match the operators that get distances
(operator-(iterator)) and move the iterator around (+, -, +=, -=, etc.).

Task-number: QTBUG-29608
Change-Id: I834873934c51d0f139a994cd395818da4ec997e2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-02-22 04:38:01 +01:00
John Layt
3aae3e81ef QMarginsF - Add new QMarginsF class
Add a new QMarginsF class to complement QMargins in the style of
QSize/QSizeF and QRect/QRectF.

[ChangeLog][QtCore] Added class QMarginsF to support handling margins
with floating-point values.

Change-Id: Iaaa95ec85f5d126d9d864fc4b607241a8c8a8f3a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-21 20:33:10 +01:00
John Layt
c7aa3a6925 QRect - Add missing QMargins subtraction operator
[ChangeLog][QtCore][QRect] Added QMargins subtraction operator.

Change-Id: I64d449e2bae81a34df2cd019cff3fb186f8aaaae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-21 20:33:10 +01:00
John Layt
9c6447e081 QMargins - Add missing operators
Add missing standard operators.

[ChangeLog][QtCore][QMargins] Added missing addition and subtraction
operators.

Change-Id: I6aeed39531a736c12d378a817a9431279da79bc4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-21 20:33:10 +01:00
Andy Shaw
ecd3027d38 Strip any trailing spaces from the filename before trying to open it
On Windows, trailing spaces in a filename are silently ignored, so we
need to strip it before trying to open a file with it. Otherwise it ends
up being stripped later and in a case like " ." it will end up causing
Qt to think that a folder exists when it does not.

[ChangeLog][Platform Specific Changes][Windows][QtWidgets][QFileDialog]
Handled the case of having trailing spaces in a filename correctly so if
the filename ends up being empty that the parent path is used instead.

Change-Id: I6500cc3a44746bf4a65e73bcfb63265a0a97c8a3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-02-21 15:58:51 +01:00
Kai Koehne
22f0dc4f89 Loosen checks for Q_COMPILER_VARIADIC_MACROS
So far we did bind the definition of Q_COMPILER_VARIADIC_MACROS to
C++11 (so gcc, clang will not define it in default gnu++98 standard).
However, variadic macros are a feature of the gcc preprocessor since
version 2.97, and are enabled in the default configurations on gcc, clang,
icc.

This might cause warnings and errors though if one enables additional
warnings in gcc, clang (e.g. by -pedantic). Anyhow, as a precedent
qglobal.h already relies on  'long long' ... The warning can be disabled
by adding '-Wno-variadic-macros'.

[ChangeLog][Compiler Specific Changes] Variadic macros are now enabled
more liberally for gcc, clang, icc. If you have warnings (because you e.g.
compile with -pedantic), disable them by -Wno-variadic-macros.

Change-Id: Ie979b85809508ad70cab75e6981f20496429f463
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-20 20:17:56 +01:00
Bernd Weimer
d641792ff2 Fix QFontMetrics width
Commit f4dd534 introduced a regression, so that QFontMetrics reported
a wrong size (to be more specific width) for FreeType fonts.
The calculation of glyph advances has to to reflect (rounded)
integral number of pixels. This was only done when the glyph was cached.
So in some cases the first call to QFontMetrics::size gave a different
result than the second.
This patch reverts f4dd5344fb.

The tst_QFontMetrics::same auto test only happened to work on some
platforms, on BlackBerry for instance it did not. Extended the test
case to make sure it works for different font sizes.

Change-Id: Ia5bb9abd3ff98193c9bba048b85207672ed8d9c3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-02-20 20:13:27 +01:00
Sergio Ahumada
170df5addb Remove qSort usages from gui tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Idf0fc471f8ab7b30a097d8faf93c93d5ebbb03ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-20 08:10:19 +01:00
Sergio Ahumada
a01b7dad50 Remove qSort usages from tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I4c48db80533802e37771d3967fa10bfb7000cb9a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-20 08:10:06 +01:00
Peter Hartmann
1de244ea65 network: add support for the SPDY protocol
Currently the only supported SPDY version is 3.0.

The feature needs to be enabled explicitly via
QNetworkRequest::SpdyAllowedAttribute. Whether SPDY actually was used
can be determined via QNetworkRequest::SpdyWasUsedAttribute from a
QNetworkReply once it has been started (i.e. after the encrypted()
signal has been received). Whether SPDY can be used will be
determined during the SSL handshake through the TLS NPN extension
(see separate commit).

The following things from SPDY have not been enabled currently:
* server push is not implemented, it has never been seen in the wild;
  in that case we just reject a stream pushed by the server, which is
  legit.
* settings are not persisted across SPDY sessions. In practice this
  means that the server sends a small message upon session start
  telling us e.g. the number of concurrent connections.
* SSL client certificates are not supported.

Task-number: QTBUG-18714

[ChangeLog][QtNetwork] Added support for the SPDY protocol (version
3.0).

Change-Id: I81bbe0495c24ed84e9cf8af3a9dbd63ca1e93d0d
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-19 21:44:15 +01:00
Oswald Buddenhagen
30fd22b957 Merge remote-tracking branch 'origin/dev' into stable
Change-Id: Ice524edcc51373509f0023ae7f7c2963f4602f88
2014-02-19 10:06:25 +01:00
Frederik Gladhorn
6aa09bbce5 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/android/qandroidplatformtheme.h

Change-Id: I541bd3069df3ab54c7942d5f4a9e155e3b6566a0
2014-02-18 14:19:36 +01:00
Sergio Ahumada
8102b75ee8 Remove qSort usages from widgets tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Ica7639d16f52b4ffcd2c00cc806fed1378a7948b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-02-18 11:59:55 +01:00
Sergio Ahumada
817c4be91f Remove qSort usages from network tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I31a701d8e17673edcb9bb7c32e6e6a87812a7fbc
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-17 19:31:01 +01:00
Thiago Macieira
83b1eaad44 Make a URL with absent authority be different from one with an empty one
This partially reverts 5764f5e6ea and
fixes the problem differently.

After this commit, "file:///foo" is still equal to "file:/foo", but
"foo:///foo" becomes different from "foo:/foo", as it should be.

Task-number: QTBUG-36151
Change-Id: Ia38638b0f30a7dcf110aa89aa427254c007fc107
Reviewed-by: David Faure <david.faure@kdab.com>
2014-02-17 18:13:42 +01:00
Frederik Gladhorn
dbafabb019 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h

Change-Id: I03d8b6e07135056baaa1d97c3c63fbe8b25583d9
2014-02-17 11:39:16 +01:00
Sergio Ahumada
f5f00e69a0 tst_qfont: Fix small typo
Change-Id: I7e007202b0cc80a1808831ebcf46ae7ec0866828
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-02-17 10:40:33 +01:00
Lars Knoll
6de515aea2 Remove a not required whitespace when writing JSON in compact format
Task-number: QTBUG-36682

Change-Id: I0c1c0de850504c8dff20a5ae724cc868d9f983f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 16:56:10 +01:00
Jørgen Lind
44ee7984fc QOpenGLTextureBlitter: fix source rect when origin is top left
This fixes the issue that the blitter required sometimes the
texture wrapping to be repeat

Change-Id: I86150d008422facf9040873b0983b0e44be9ad24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-16 11:06:40 +01:00
Jørgen Lind
937a4f5443 QOpenGLTextureBlitter: Remove Origin location for the Target rect
The Origin for Target rect was deemed a confusing concept. The current
implementation would translate the target rect to the coordinate system
specified. However, the order and "direction" of the vertices would
always be the same. So drawing a texture in for one target rect defined in
one coordinate system would paint the texture the same way as it would
when a texture was drawn for a target rect drawn in the "opposite"
coordinate system. The point with this was that if you wanted to "flip"
the texture you would specify that with the source coordinate system.

However, this approach breaks on different levels, such as QRect has functions
which expects a top left coordinate system (ie. top() and bottom()).

In the end Qt uses a top left coordinate system, hence QWindow specifies
a top left coordinate system, and hence the api becomes easier if it is
not possible to define the coordinate system of the target viewport.

Change-Id: I7dd59b3718380876e87a4bff88381d7a1c7d58c1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-16 11:06:19 +01:00
Jørgen Lind
6fbef080a0 QOpenGLTextureBlitter: add some autotests
Change-Id: I07a4847a19908c1a6d7fb02649b306dfa0148f49
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-16 11:06:00 +01:00
Thiago Macieira
579526cfec Make the printing of complex Unicode in a QString prettier
This also has the advantage of not requiring the use of the locale
codec. Quite an advantage if you're debugging the locale codec. But it's
mostly so that we don't get question marks that hide the difference we
were trying to locate.

[ChangeLog][QtTest] QtTest now prints an escaped version of QStrings
that failed to compare with QCOMPARE. That is, instead of converting
non-printable characters to question marks, QtTest will print the
Unicode representation of the character in question.

Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-16 06:54:18 +01:00
Thiago Macieira
634f82f1f1 Add a testAndSet overload to the atomics that returns the current value
This is extremely useful, since the most common action after a failed
compare-and-swap is to loop around, trying again with the current
value as found in memory.

Code currently written as:
    do {
        Type value = atomic.load();
        ...
    } while (!atomic.testAndSetRelaxed(value, desired));

Becomes:
    Type value = atomic.load();
    do {
        ...
    } while (!atomic.testAndSetRelaxed(value, desired, value));

In most CPU architectures, the value that was found in memory is known
to the compare-and-swap code, so this is more efficient than the
previous code. In architectures where the value is not known, the new
code is no worse than before.

The implementation sometimes modified an existing function, sometimes
it added a new one, depending on whether more registers were needed in
the assembly (like ARMv6-7), the code became more complex (ARMv5), the
optimizer failed (C++11), or it was just plain equivalent (MIPS).

Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 05:12:26 +01:00
Marc Mutz
c0791ac76e Add qHash() overloads for floating-point types
This implementation is based on GCC's implementation of std::hash<FP>, but only
to the extent of checking for zero before hashing the bits. The bit hasher is
the Qt one; I didn't even look what GCC uses.

The check against 0.0 is mandated by the requirement to have
  \forall x,y: x == y => qHash(x) == qHash(y)
which would be violated for x = 0.0 and y = -0.0 if we only hashed the bits.

Implemented out-of-line to avoid potential FP-comparison warnings, as well
as to be able to use the file-static hash() functions, which gets inlined
unlike qHashBits(), which cannot be.

[ChangeLog][QtCore][QHash/QSet] Allowed to use float, double and long double
as QHash/QSet keys.

Change-Id: I38cec4afb860f17e9f8be7b67544e58b330f8fff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-02-16 00:18:32 +01:00
Marc Mutz
6afc34a72f tst_qsignalblocker: simplify test
This test can assume that the QObject::signalsBlocked property works as
advertized, so just check signalsBlocked() in repsonse to QSignalBlocker
manipulations.

Change-Id: I99e4ef9c4ed05c3840233d92a587636d2d78f59a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-02-16 00:18:32 +01:00
Kai Koehne
c9cdbcb12f Add const overload for QLoggingCategory::operator()()
Change 85e57653 caused a compile error for code that does

  Q_DECLARE_LOGGING_CATEGORY(cat);
  //..
  qCDebug(cat()) << // ...

error: C3848: expression having type 'const QLoggingCategory' would lose
some const-volatile qualifiers in order to call 'QLoggingCategory
&QLoggingCategory::operator ()(void)'

This is a regression from Qt 5.2. Fix the error by adding a const version
of operator()().

Change-Id: I2fb04f2e155962adee0f98089fc5a159000bef56
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-15 21:57:43 +01:00
Oliver Wolff
553c6416bb WinRT: Added socket engine implementation
Added basic functionality to socket for WinRT. Even though not
all auto tests pass yet, this patch can be seen as a foundation
for upcoming work in this area. Reading from and writing to TCP
socket works and one can listen for tcp connections.

Change-Id: Id4c25ba1c7187ed92b6368c785c4f62837faded7
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-02-15 10:50:12 +01:00
Jędrzej Nowacki
f96f2fe367 Enable QByteArrayList tests
Change-Id: Id7e0550e857bf4221f49d08539a0b5c70d8386d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-14 15:16:09 +01:00
Olivier Goffart
2b0f02aa5c moc: Fix parsing of operator<
moc would skip the 'operator' keyword as unknown and try to parse a type again
but as it sees the '<' it looks for the corresponding '>' which does not exist
types can't start with '<' anyway, so return an invalid type and continue
parsing as usual

Task-number: QTBUG-36834

Change-Id: If3d27076ef9947abf8c57c594713eece9334d0b0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-02-14 14:33:17 +01:00
Laszlo Agocs
97c187da3c Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.

Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.

In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.

When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.

Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):

1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.

QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.

2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".

3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.

4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().

The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.

Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.

If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.

Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.

The textures example application is ported to OpenGL 2, the GL 1
code path is removed.

[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.

Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-14 10:51:44 +01:00
Bernd Weimer
3cdd0358b3 Fix QDateTime auto test
Conversion from UTC to local time will result in same datetime value,
if local time is in UTC.

Change-Id: Icd4ea57cb46cc97bcc8fce4f4e579bf64a4d4b10
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-02-14 10:51:44 +01:00
Olivier Goffart
2b26f801b5 Make parsing of template arguments more robust.
At first, my goal was just to fix Moc::until() to parse properly
template arguments containing expressions containing > or >>
such as Foo<(8>>2)>

But with the test, I realized that normalizeType also requires change
not to split the > > too much.

And QMetaObjectPrivate::decodeMethodSignature should not interpret
the ) within the template parameter as the end of the function.

Change-Id: Ia9d3a2a786368aeda1edcf66280d70f64cf05070
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-14 09:42:53 +01:00
Christian Strømme
2223cc8a2d Add function to get the actual PID from QProcess
It was not possible to get the actual process ID (in a cross-platform
manner) from QProcess, as the user would need to handle the returned
typedef (Q_PID) differently on Unix and Windows.

On Unix Q_PID is the actual process ID, but on Windows it's a pointer
to a PROCESS_INFORMATION structure, which among other fields contains
the process ID. Instead of returning a pointer on Windows,
QProcess::processId() will return the actual process ID on both Windows
and Unix.

[ChangeLog][QtCore][QProcess] Added processId() to QProcess. This
function will, unlike pid(), return the actual process identifier on
both Window and Unix.

Task-number: QTBUG-26136
Change-Id: I853ab721297e2dd9cda006666144179a9e25b73d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-14 00:34:25 +01:00
Thiago Macieira
8dcb72fd1e Add a CSV logging feature to the benchlib
This is only useful for logging benchmarks, since it won't print test
passes, failures, etc. It's useful for importing to spreadsheets to do
number-crunching.

[ChangeLog][QtTest]Added a CSV logging mode that is suitable for
importing benchmark results into spreadsheets. This can be enabled by
the -csv option on the command-line. The CSV logging mode will not print
test failures, debug messages, warnings, etc.

Change-Id: I245d6f86bb380645c9bc0d748cf474b3ed42cab8
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-02-14 00:34:25 +01:00
Laszlo Agocs
ff11af4fbc QOpenGLWidget and new-style compositing on eglfs
Integrate with QOpenGLTextureBlitter, QOpenGLWidget and friends.

Change-Id: Ic2867b713a21a3d2820d546174fc9164b3dd220c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-02-13 20:54:01 +01:00
Konstantin Ritt
7ac97d7efb Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-13 09:35:08 +01:00
Glen Mabey
4f23f0530a new QByteArrayList class
Initial submission of a new class QByteArrayList with the
purpose of aggregating and then joining QByteArray instances.

[ChangeLog][QtCore] Added new QByteArrayList class.

Change-Id: I2a9dc71ff7aadb19ebc129a0d47ac8cd33895924
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-12 20:12:17 +01:00
David Faure
f42bd772f8 Move setWindowIcon() up to QGuiApplication.
[ChangeLog][QtGui][QWindow]QWindow::icon() now defaults to the application
icon, which can be set with QGuiApplication::setWindowIcon().

Change-Id: Id1974e5cda81775e515c14b294f67fb99351c6c9
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-12 20:12:17 +01:00
David Faure
bf82245baf Restore support for -title command line argument on X11, add -qwindowtitle.
-title disappeared between Qt4 and Qt5, due to all the refactorings around QPA.
Making the caption of the mainwindow configurable allows custom setups
for specific users or use cases.

[ChangeLog][QtGui][QGuiApplication] Restore support for -title command line
argument on X11, add -qwindowtitle on all platforms.

Change-Id: I73e6bf21248f3419178eba583b257172a175e74e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-12 20:12:17 +01:00
Paul Olav Tvete
eacd58d4e7 Enabling QQuickWidget and QOpenGLWidget
Enable child widgets (without a native window) that render to an FBO
and are composed with the raster backingstore by the platform plugin.
A preliminary version of QOpenGLWidget is included as private API.

Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-12 20:12:17 +01:00
Friedemann Kleint
5ae5bebb93 Added function returning build information to QLibraryInfo.
Useful for bug reports and test logs.

[ChangeLog][QtCore] QLibraryInfo provides information on how
Qt was built.

Change-Id: I867197fd7d2e10bcdf01a8eb47c9c1e03647e2c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-12 17:24:33 +01:00
Frederik Gladhorn
a9c88c1f39 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/image/qimage.cpp
	src/gui/text/qtextengine.cpp
	src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
	src/printsupport/kernel/qprintengine_win.cpp

Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
2014-02-12 16:28:07 +01:00
J-P Nurmi
4d6cb199b8 Make QToolButtonPrivate::popupTimerDone() more robust
Avoid dereferencing the q-pointer if the button has been
destructed meanwhile popup was open.

Task-number: QTBUG-26956
Change-Id: I68190e9fe84c669229ae0ce4d573ee7a02a8a141
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-02-12 01:41:15 +01:00
Kai Koehne
a2bfd11493 Allow configuration of logging rules from file system
Allow configuration of logging rules from outside of the application,
either through a configuration file (.config/QtProject/qtlogging.ini),
or through a file specified by a QT_LOGGING_CONF environment
variable.

The logging rules from the different sources are concatenated: First
the rules from QtProject/qtlogging.ini are applied, then
QLoggingCategory::setLoggingRules(), finally from the environment.
This allows an application to overwrite/augment the system wide rules,
and in turn that can be tailored for a specific run by setting a
configuration in the environment variable.

[ChangeLog][QtCore][Logging] The logging framework can now be configured
with an .ini file.

Change-Id: I442efde1b7e0a2ebe135c6f6e0a4b656483fe4b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-11 20:59:15 +01:00
Peter Hartmann
c5042d68ea network tests: do not rely on external servers
They cause test failures from time to time.

Change-Id: I917bef340401d25bf54e133be9d9562b3b133c9f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-11 16:03:02 +01:00
Peter Hartmann
42cfb5fe4d SSL: add support for the Next Protocol Negotiation extension
... which is needed to negotiate the SPDY protocol.

[ChangeLog][QtNetwork][QSslConfiguration] Added support for the Next
Protocol Negotiation (NPN) TLS extension.

Task-number: QTBUG-33208

Change-Id: I3c945f9b7e2d2ffb0814bfdd3e87de1dae6c20ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-02-11 15:37:10 +01:00
Frederik Gladhorn
df62c31807 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-11 15:12:00 +01:00
Joerg Bornemann
cbc6387a28 support c'tor as second parameter in foreach macro
Passing a constructor as second argument to foreach didn't work when
building with gcc.
For MSVC this already worked as a different foreach implementation is
used.

Change-Id: Id98444c699b4cebc14ea62076c5f7cba33ffb824
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-02-11 13:28:35 +01:00
Allan Sandfeld Jensen
15f3191981 Fix drawing vertical gradients in RGBA8888 formats
The RGBA8888 formats was incorrectly using the qt_gradient_quint32
which is argb specific. This caused vertical gradients but only
vertical gradients to be drawn incorrectly.

This changes the RGBA8888 formats formats to use the generic gradient
method and renames qt_gradient_quint32 to qt_gradient_argb32 to
indicate its limitation.

Change-Id: Ia1cd48ca7f4f78b64f31d6263e81cd8ac3b0954e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-10 23:02:47 +01:00
Giorgos Tsiapaliokas
d61e774307 Print qCDebugs in arbitrary categories by default
The debug output of all categories will be visible by default,
except from the "qt.*" categories. "qt.*" categories are private
and their default debug output will be hidden.

[ChangeLog][QtCore][Logging] Enable qCDebug's for all categories except qt one's

Change-Id: Ibe147c8bbe0835a63b3de782288b9c3251321d8f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-10 16:28:30 +01:00
Jorgen Lind
a80253ae4c QOpenGLTextureBlitter
private api, but useful for 2d gui code that suddenly finds itself
needing to get a set of textures onto some fbo

I didn't want to include ARB_copy_image since it looks like its from
texture/renderbuffer -> texture/renderbuffer while this class implies
texture -> write fbo. We could wrap ARB_copy_image in QOpenGLTexture or
some other class or we can add it later.

I have not added any QOpenGLTexture functions since this class opperates
on the GLuint identifier. We can add overloads later.

Change-Id: I3e565b33466c1c183a249a33c3e82c6786debd55
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-02-10 12:49:06 +01:00
David Faure
5c9d671bfb QStandardPaths: fix empty path in XDG_DATA_DIRS being treated as '/'.
The basedir xdg spec says:
"All paths set in these environment variables must be absolute.
If an implementation encounters a relative path in any of these variables it
should consider the path invalid and ignore it."
Therefore we ignore relative paths including the empty string.

Change-Id: I8f779b78981018051b16de23b2514f2e62b7ab39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-10 11:00:41 +01:00
Thomas McGuire
6f5db32abe Don't deadlock when deleting slot objects in QMetaObject::activate()
The slot object was deleted after the mutex was relocked, which caused
a deadlock in case the functor destructor locked the same mutex again.

Change-Id: I5b4fb22fdb4483f91c89915872bfd548c31b0eea
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-02-08 14:32:53 +01:00
David Faure
3e8af132df QStandardPaths: ensure that paths use '/' on all platforms, as the comment said
Change-Id: Id70b5e92c07f63e71e7a1a8fb229f927d352ebdd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-08 10:50:25 +01:00
Morten Johan Sørvig
c8848a5e98 Compile.
Change-Id: Ib0e7e7aa2964835afda4055a5fe76abbd5db84e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-08 10:43:58 +01:00
Jan Arve Saether
de1b98e9c1 Fallback to QWidget::grab() if QScreen::grabWindow() fails.
QScreen::grabWindow() is not always reliable because it grabs from the
framebuffer. (The window might then be covered by other windows, e.g.
"Stays on top"-Windows, popups etc).
If QScreen::grabWindow() fails we therefore fallback to
QWidget::grab(). This will not grab from the frame buffer, but it will
ask the widget to render itself (with its current state) to a pixmap
and return it.
QWidget::grab() should usually return the expected pixmap, and the
pixmap it gives is not subject to the state of the window manager.

This means that both QScreen::grabWindow() *and* QWidget::grab()
must produce an unexpected pixmap in order for the test to fail.

Change-Id: I276554155bb1e5b510d2a2d43628d91669464fe2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-07 23:52:49 +01:00
Giuseppe D'Angelo
bcd1b7fe8e Fix QString::toUcs4 returning invalid data when encountering stray surrogates
Code units 0xD800 .. 0xDFFF are not UCS-4, so we can't happily return them.
Instead, if we encounter a stray surrogate, replace it with 0xFFFD, which
is what Unicode recommends anyhow.

References:

§3.9 Unicode Encoding Forms

    D76: Unicode scalar value: Any Unicode code point except high-surrogate
    and low surrogate code points.

    As a result of this definition, the set of Unicode scalar values consists
    of the ranges 0 to D7FF_16 and E000_16 to 10FFFF_16, inclusive.

    [...]

    UTF-32 encoding form: The Unicode encoding form that assigns each Unicode
    scalar value to a single unsigned 32-bit code unit with the same numeric
    value as the Unicode scalar value.

§ C.2 Encoding Forms in ISO/IEC 10646

    UCS-4. UCS-4 stands for “Universal Character Set coded in 4 octets.” It is
    now treated simply as a synonym for UTF-32, and is considered the canonical
    form for representation of characters in 10646.

§ 3.9 Unicode Encoding Forms (Best Practices for Using U+FFFD)
and
§ 5.22 Best Practice for U+FFFD Substitution

    Whenever an unconvertible offset is reached during conversion of a code
    unit sequence:

    1. The maximal subpart at that offset should be replaced by a single
    U+FFFD.

    2. The conversion should proceed at the offset immediately after the
    maximal subpart.

    [...]

    Whenever an unconvertible offset is reached during conversion of a code
    unit sequence to Unicode:

    1. Find the longest code unit sequence that is the initial subsequence of
    some sequence that could be converted. If there is such a sequence, replace
    it with a single U+FFFD; otherwise replace a single code unit with a single
    U+FFFD.

    2. The conversion should proceed at the offset immediately after the
    subsequence which has been replaced.

[ChangeLog][QtCore][QString] QString::toUcs4 now does not return invalid
UCS-4 code units belonging to the surrogate range (U+D800 to U+DFFF)
when the QString contains malformed UTF-16 data. Instead, U+FFFD
is returned in place of the malformed subsequence.

Change-Id: I19d7af03e749fea680fd5d9635439bc9d56558a9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-07 15:00:36 +01:00
Frederik Gladhorn
a1fe728fa5 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp
	src/plugins/platforms/android/androidjnimain.cpp
	src/plugins/platforms/android/qandroidplatformintegration.cpp
	src/plugins/platforms/android/qandroidplatformintegration.h
	src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/sql/doc/src/sql-driver.qdoc
	src/widgets/widgets/qtoolbararealayout.cpp

Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
2014-02-07 13:07:25 +01:00
Thiago Macieira
125bb81bef Fix compilation after b0afad8f0b
That commit made QString::toXxx (8-bit) functions use C++11 ref
qualifiers, so we need to match it here.

Change-Id: I45b50464d36f858d012b12e0cb511aae347ddb6f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-07 04:47:12 +01:00
Giuseppe D'Angelo
8cbe52d581 Long live QStringIterator!
UCS-4 iterator over a QString.
Kept private for now so we can still work on the API.

Done-with: Thiago
Change-Id: I377f8bb1921e591ee3292c08c3e097fb6bc7f0c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-07 04:47:04 +01:00
Thiago Macieira
b2d5e7805a Add QString::fromUtf16 with char16_t and fromUcs4 with char32_t
Because they make sense. I'm even thinking that the char16_t version
should get a QString implicit constructor. Maybe both encodings.

Change-Id: Ifffc61dd890795fbbbd5f7cb5efb3e6287d1270e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-07 04:47:04 +01:00
Gabriel de Dietrich
b1714aec51 Cocoa: Allow frameless NSWindow child QWindows
Showing, moving and resizing

Contrarily to what an NSWindow does to its NSViews, child NSWindows need
to be explicitly shown and hidden, and clipped if the parent NSWindow
changes geometry. Also, hiding an NSWindow will not hide its child
windows. This needed to be managed manually, adding 2 additional states
to QCocoaWindow to reflect whether a child window has been clipped out by
any ancestor geometry change, or hidden by any ancestor being hid. Also,
ordering out an NSWindow will remove it fromm its parent's child windows
array, making necessary to maintain a parallel list of child windows in
QCocoaWindow.

Stack order

Although child NSWindows can be ordered relatively to each other, they
need to be added again to be moved lower in the window stack. This also
means the windows above it need to be added on top.

Key (focus) status

One of the remaining issues, is to make sure the top level window keeps
the "key status" while still forwarding key events to the child window.

Keeping same event propagation

This use case is best illustrated with undocking QDockWidgets (if these
are child NSWindows). The main issue is to make sure the QDockArea will
get the mouse events right after undocking a dock widget. We used a similar
workaround as the "key status" problem, and manually forward the mouse
events to the dock area's QWindow.

Manual test, by Morten Johan Sørvig, included.

Task-number: QTBUG-33082
Task-number: QTBUG-22815
Change-Id: I50e34936fb82bff013e99f4bcb3bd0db0704c6ae
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-05 23:12:50 +01:00
J-P Nurmi
65bd80ebfc QTabWidget: fix moving of the current tab
Task-number: QTBUG-36455
Change-Id: I38687283d60fe38a4b586b064d5ddd4ed3be06b6
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Ivan Komissarov <ABBAPOH@me.com>
2014-02-05 23:04:04 +01:00
John Layt
75aef26c27 QPageSetupDialog - Add manual dialog test
Add QPageSetupDialog to the manual dialog test.

Change-Id: I5a7a4fedf1fe3ba074891eaed84efaa1c173e620
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:34:10 +01:00
John Layt
5af95d077b QPrinter - Fix Printer Selection option on Windows
Make the printer selection option api public on Windows to be
consistent with Mac, and with the print program api which is already
public.

Change-Id: I3da9684288348eaa43276ca8534a1d5809f7027b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:34:03 +01:00
John Layt
27c33a8f7a QPrintEngne - Fix PPK_Creator
Add support to the Mac and Windows print engines to preserve the
creator name when switching between native and pdf format.

Change-Id: Ie036af3140f24d8e34aa886f091384f93aa0157b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:59 +01:00
John Layt
0ee72b09fd QPrintEngine - Fix PPK_CollateCopies
Mac supports Collate Copies using native api, so add support.  Note
this is mostly only useful for setting the print dialog default, as
Mac supports server-side multiple copies so the app will never need to
collate the copies itself.

Change PDF and Windows to default to collate true to match Mac as this
is the behavior users expect.

Task-number: QTBUG-27724
Task-number: QTBUG-35251
Task-number: QTBUG-22144

Change-Id: Ia43dbc260b3a71aa5b267cca54c168ffbea794fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:54 +01:00
John Layt
27473f19bb QPrintEngine - Fix PPK_DocumentName
Add support to the Mac print engine for set/get the Document Name using
the Job Name setting. Our documentation states this is one use that the
document name will be put to so is appropriate to be used.

Change the Windows print engine to default to a blank Docuemnt Name
consistent with the other print engines. If still blank when printing
then use a default value.

Task-number: QTBUG-27724
Task-number: QTBUG-22144

Change-Id: If590811b5720e6f759eabc290b578b94e221f9f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:50 +01:00
John Layt
053bee8b80 QPrinter - Clean up Print Engine Key defaults and tests
The PrintEngine keys are not consistently treated across the platforms
and are not properly tested.  Start the process of making the print
engines behave consistently by documenting and testing the current
behavior. Ensure all unsupported features return a consistent
default value.

The auto test for valuePreservation() has been flaky depending on the
platform and installed printers so remove it and replace it with more
complete testing.  If no native printers available then don't test
the native engines.

Fixes for the individual inconsistent keys will follow.

Task-number: QTBUG-26430

Change-Id: Iab914d7e0a5ae4a2cdc24c8645751f0910cf440c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:42 +01:00
Eskil Abrahamsen Blomfeldt
35579f6fe7 Support empty inline elements in block tags in QTextDocument
This fixes the following case:

<blockquote>
<span />Foobar
</blockquote>

Qt would see the end of <span>, and consider the current block
tag as closed, thus resetting the block format, thus losing the
margin set for the current block (due to blockquote).

If you do

<blockquote>
<span>Foo</span>Foobar
</blockquote>

instead, then the same would not happen, since hasBlock is set
to false when we append text to the current inline node.

[ChangeLog][QTextDocument] Add support for empty inline elements
in block tags.

Task-number: QTBUG-33336
Change-Id: Ic566edfec96cb8d44d1c02932bb195bc921d1580
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-05 09:10:25 +01:00
Andy Shaw
060b853a2f Actually print when the tester pushes the print button
Change-Id: I5c995938a74f720be5beb33160488ec1ec73c0ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-05 08:51:55 +01:00
Jake Petroules
fdef360bad QFileSelector: correct the macros for Apple platforms.
This fixes a serious regression from
7d72516b52.

[ChangeLog] QFileSelector: the identifier for OS X has been changed back
to 'osx' from 'mac', and 'mac' and 'darwin' have now been added as
selectors for Darwin OS (which is the base of both OS X and iOS).

Task-number: QTBUG-35073
Change-Id: I83183e34c5a697338cc1ddcac33a41bd379ded12
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-02-04 19:36:58 +01:00
Nils Jeisecke
6894bc0f3f Fix sorted QSortFilterProxyModel filter update
When changing a filter so that a previously empty proxy model becomes
populated sorting was not applied correctly.

This was caused by using mapToSource for getting source_sort_column
from proxy_sort_column. For an empty proxy model this won't work because
no valid proxy index can be created in this case.

We now directly use the root index column mapping instead by doing
essentially the same as QSortFilterProxyModelPrivate::proxy_to_source
but without the sanity checks needed for external use.

The sorting feature of QSortFilterProxyModel has always assumed that
the number of columns is specified by columnCount(QModelIndex()) so
the behavior doesn't change.

[ChangeLog][QtCore][QSortFilterProxyModel] Fixed sorting when a
previously empty proxy model becomes populated because of a change in
the filter.

Task-number: QTBUG-30662
Change-Id: I21322122e127889dfadc02f838f0119ed322dcab
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-02-03 22:12:20 +01:00
Bastiaan Veelo
5e99b07a07 Fix setWindowFlags() for QMdiSubWindow.
It was impossible to hide/show the close button after a QMdiSubWindow
was created.

Task-number: QTBUG-9933
Task-number: QTBUG-27274

[ChangeLog][QtWidgets][QMdiSubWindow] Fixed setWindowFlags() for QMdiSubWindow.

Change-Id: I7db9a1bef5ba8a8ace729acb85682c8b3de9c33c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-02-01 15:50:26 +01:00
Christian Loose
f40c28f915 Q(Plain)TextEdit: Add find() overload with QRegExp
Add overloads to the find() methods in QPlainTextEdit and QTextEdit
that find the next occurrence matching the passed regular expression.

These are convenience methods that eliminate the need to use the
document() method and the need to handle the QTextCursor return value.

[ChangeLog][QtWidgets][QPlainTextEdit] Added find method overload using QRegExp

[ChangeLog][QtWidgets][QTextEdit] Added find method overload using QRegExp

Change-Id: Ia6139b771e3ae4ca02e4b8ea7fde19e5dc71b9d8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-01-31 21:51:35 +01:00
Friedemann Kleint
62a3aaf3f1 Fix MSVC-warning about unused variable eventdispatcher.
Change-Id: Ic7c12f16c310cc681bba39a7969de235afcf0f44
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-31 10:21:50 +01:00
Allan Sandfeld Jensen
5f59207bd3 Optimize drawing to and from generic formats
When drawing to and from the less common formats most of the cpu time
is spend in conversion. The conversion method is rather slow due to
using variable shifts and masks that the compiler does not have a chance
to optimize.

This patch changes the conversion methods to being templates fed by
constexpr methods. This allows the compiler to fully optimize the methods
yielding 2x->5x speedups.

The reliance on constexpr however means the optimized methods are only
used under C++11.

Change-Id: I2ec77c4c1c03f12ee463a694a2b59db0f0b52db1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-31 00:24:48 +01:00
Konstantin Ritt
f26928cccf Allow QTextCharFormat::setFont() to skip unresolved font props
This makes the font merging possible and solves an issue
with the default font properties inheritance when used
in conjunction with QTextFormatCollection.

Change-Id: If8b543c011122dde9f086f5d696df3b042f7b90c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-31 00:24:48 +01:00
Friedemann Kleint
f6723cf0d4 tst_qpauseanimation: Fix condition in QEXPECT_FAIL.
introduced by  b0b22e8d49 .

Change-Id: Ia57331ce9373a414f2bc56962412f20ef83bd7ca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-30 22:10:22 +01:00
Thiago Macieira
aba30f0234 Replace the type-based QAtomicIntegerTraits with a size-based one
This simplifies the code a lot and avoids silly mistakes where a
specific integer type is missing (such as char16_t).

Change-Id: Id91dfd1919e783e0a9af7bfa093ca560a01b22d1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-30 18:06:27 +01:00
Friedemann Kleint
1cc0a18d79 Revert "test: marked tst_qlocale as insignificant on Windows"
This reverts commit b7486591cd.

Conflicts:

	tests/auto/corelib/tools/qlocale/test/test.pro

Task-number: QTBUG-25284
Task-number: QTBUG-36306
Change-Id: If4a335c114302f7af999d7a254e1aa55b2df7176
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-30 18:04:59 +01:00
Konstantin Ritt
a5614264d5 Get rid of QGlyphLayout::advances_y
...and thus consume 4 bytes less per glyph and increase the performance a bit.
It seems, the only CTFontGetAdvancesForGlyphs() returns both x and y
advances, though y advances are always equal to 0 for horizontal
orientation and x advances are always equal to 0 for vertical orientation.

Also, rename `advances_x` to `advances` for consistency
and declare QGlyphLayout's data size in a single place.

Change-Id: I56b20f893f8a6feb7aa870e3edbca99dd93ba2e2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-30 12:43:33 +01:00
Mandeep Sandhu
fd5dd27126 Add more specific HTTP error codes to QNetworkReply::NetworkError
A few more HTTP status codes from the 4xx and 5xx series have been
added to QNetworkReply::NetworkError.

For content errors, the following codes have been added:
1. 409 - Resource Conflict
2. 410 - Resource Gone

For server related errors, the following codes have been added:
1. 500 - Internal Server Error
2. 501 - Operation Not Implemented
3. 503 - Service Unavailable

Few of the above codes are quite possible when communicating with REST
based services.

NOTE:
=====
* HTTP error status 400 is interpreted as
QNetworkReply::ProtocolInvalidOperationError.
* QNetworkReply::UnknownServerError is returned for all server related
errors (5xx) not listed above.

[ChangeLog][QtNetwork][QNetworkReply] Added more (specific) HTTP status
codes to NetworkError enum.

Task-number: QTBUG-30880
Change-Id: I9d2a133f6b3869f26710c6eb930dd8b08df31108
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-01-30 07:56:47 +01:00
Konstantin Ritt
b80fcbdba6 Introduce QChar::JoiningType enum and QChar::joiningType() method
This aimed to disctinct joining types "L", "T", and "U" from just "U".
Unicode 6.3.0 has introduced a character with joining type "L" and
Unicode 7.0 will add a few more characters of joining type "L", so
we'll have to deal with it anyways.

[ChangeLog][QtCore][QChar] Added JoiningType enum and joiningType()
 method that deprecates the old QChar::Joining enum and joining() method.

Change-Id: I4be3a3f745d944e689feb9b62d4ca86d1cf371b0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-29 23:19:47 +01:00
Allan Sandfeld Jensen
ff70c39ebc Ensure QImage::pixel() on RGB32 images returns valid QRgb values
Currently QImage::pixel() returns the raw underlying pixel values for
RGB32. For all other pixel formats the returned value is either valid
ARGB32 or ARGB32PM.

This patch masks the undefined alpha field in RGB32 so that the return
value is well defined QRgb. It also fixes one test that relied on the
previous behavior.

Change-Id: If37463528268b7419733499d1f7bfd0d1097d21e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-29 19:41:57 +01:00
Allan Sandfeld Jensen
0226795cf3 Round evenly in INV_PREMUL
Currently INV_PREMUL rounds strictly down. While PREMUL rounds evenly.

This patch adds 0x8000 to the intermediate results in INV_PREMUL before
right shifting, thereby achieving even rounding.

The rounding also makes PREMUL(INV_PREMUL()) into an identify operation,
which means we can safely convert ARGB32PM to ARGB32 and back without
ever losing color details. A test is added to verify this.

Change-Id: I1267e109caddcff0c01d726cb5c1c1e9fa5f7996
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-29 08:54:55 +01:00
Frederik Gladhorn
85a2653737 Enable running sql model tests in parallel
Each model test gets its own temporary directory, thus there is no problem parallelizing them.

This should reduce the time spent for a testrun of qtbase by around 3 minutes.
When running only the sql tests it saves less since there are no other tests to run in parallel.

=== Timing: =================== TEST RUN COMPLETED! ============================
  Total:                                       4 minutes 43 seconds
  Serial tests:                                4 minutes 42 seconds
  Parallel tests:                              1 second
  Estimated time spent on insignificant tests: (no time)
  Estimated time saved by -j4:                 1 second
=== Totals: 12 tests, 12 passes ================================================

After:

=== Timing: =================== TEST RUN COMPLETED! ============================
  Total:                                       4 minutes 7 seconds
  Serial tests:                                50 seconds
  Parallel tests:                              3 minutes 17 seconds
  Estimated time spent on insignificant tests: (no time)
  Estimated time saved by -j4:                 1 minute 23 seconds
=== Totals: 12 tests, 12 passes ================================================

Change-Id: I355ceed62fae852ad8cd442848e263438afb738e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-01-29 06:40:49 +01:00
Olivier Goffart
e13b0cc4a0 Fix usage of QObjectPrivate::connect when q_func() is private.
q_func() which is declared in Q_DECLARE_PUBLIC is usually private.
We should use q_ptr directly in QObjectPrivate::connect, otherwise
it does not compile when trying to access the private q_func

Change-Id: I235165a0994327102dbb31c390c2cafdffe806dc
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-29 00:18:15 +01:00
Allan Sandfeld Jensen
b7396dc39f Tests for semi transparent blend on opaque formats
This patch adds tests for the consistent handling of transparent
drawing results on opaque formats that was introduced with commit
6f7d370ade

Change-Id: If5d11d0f2e111ef88490a4dc20a64b0858ad5426
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-29 00:18:15 +01:00
Friedemann Kleint
6ab6ab73fe Fix tst_QLocale::windowsDefaultLocale().
Adapt to Windows-version-specific changes.

Task-number: QTBUG-36306
Task-number: QTBUG-33718

Change-Id: I8275423f6f79ede3c3903a646b731eba2182e83c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-28 19:33:29 +01:00
Fabian Bumberger
a4ff400e25 Fix application font removal when using FontConfig
This patch fixes an issue when a font that was added with QFontDatabase::addApplicationFont
can not be removed any more.
The reason for that is that QFontconfigDatabase::addApplicationFont adds the font to the FontConfig
application set from where it cannot be removed any more and is picked up every time the font database is
repopulated (e.g. after a call to QFontDatabase::removeApplicationFont).

This also fixes the QFontDatabase autotest which unfortunately does not fail on linux, because it tries
to add "FreeMono" (which in most cases is already there as a system font). So this patch removes FreeMono and adds
LED_REAL as test font.

Change-Id: I2fa5f4df0ad2099ac28673760ea25234c725dfc6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-28 19:32:40 +01:00
Friedemann Kleint
22ec4ed866 QPrintDialog manual test: Break endless loop for invalid DPI.
Change-Id: I8684f144e27392f834f91adef17826b77de60b93
Reviewed-by: John Layt <jlayt@kde.org>
2014-01-28 13:41:10 +01:00
Friedemann Kleint
0841a5e367 tst_qcolumnview: Set layout direction on widgets instead of application.
Most of the test is executed in RTL mode since it is never restored.

Task-number: QTBUG-36395
Change-Id: I110966085a5a265f093fc4479eebc1f1bf0614c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-01-28 08:27:53 +01:00
Friedemann Kleint
b7de9e7353 Use a fake directory model instead of QDirModel in item view tests.
The tests then have a predictable, stable environment and do not depend
on file system operations.

Task-number: QTBUG-23697
Change-Id: Ibbd356f8bd7419ec4a3a88d2c0b5cd0830049790
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-27 15:40:17 +01:00
Bastiaan Veelo
9ac20dc44c tst_qmdisubwindow: WindowCloseButtonHint is a standard window flag, too
Implemented that way in src/widgets/widgets/qmdisubwindow.cpp:2081.

Change-Id: I82fdf0c04f1655a130c5e6a6f1e23d325d546ab3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-27 15:40:17 +01:00
Kai Koehne
7d782d4cf9 Fix QArrayData check
The support for QArrayData variadic arguments without C++11 for GCC
has been removed in commit 69478da0f0 . Change the autotest to reflect
that, too.

Change-Id: I40468f5d67cb2db553fd7a7d5b604f46403ac538
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-26 20:03:34 +01:00
Friedemann Kleint
cff2b83b10 Fix MSVC 64bit warnings about int64 truncation in tests.
Change-Id: Ic98090dbc7e320df652a60fc67a5291c60f7796a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-24 22:06:15 +01:00
Friedemann Kleint
1fb42377a2 Fix MSVC-warnings about double to float truncation.
Change-Id: I4aef12bd8fe37dffb06fc7d0b6a330bfc42fa270
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-24 20:26:39 +01:00
Friedemann Kleint
0d95f7c0be Fix crash of tst_qaccessibilitylinux when DBus is not available.
Change-Id: I32291e4c6a5b228b42a7ec15f1dbfe4302bd31fa
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-24 11:30:58 +01:00
Jan Arve Saether
f7ca7ae50e Make the QEXPECT_FAIL agree with the QVERIFY2 condition below
Even if the system is not under high load, this test can generate 4
updates on Windows. This is seems to be because the timer actually
triggers before its supposed to (sometimes the second start() triggers
an update right before the animation is done (at timestamp 399 for
instance), forcing it to generate yet another timer event in order to
reach the end)).

Under high load conditions, too many things can break this test,
usually it finishes even before the pause(), causing the
QVERIFY(animation.state() == QAbstractAnimation::Paused);
to fail.

Change-Id: Id94c0d16656675bc6165b7795f3c41a30616a3ba
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-24 09:15:47 +01:00
Allan Sandfeld Jensen
c695543f76 Ref qualified version of QImage::convertToFormat
Add ref qualified versions of QImage::convertToFormat, so that a
temporary QImage can be converted in-place to a format of equal depth.

[ChangeLog][QtGui][QImage]Added rvalue qualified convertToFormat method
for in-place conversion

Change-Id: I2eed5ffd63f5aea4ffa1147bf7607b02a49d9c5d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-23 18:20:49 +01:00
Thiago Macieira
ea8e48a679 Update the qHash function for strings to use the CRC32 instruction
According to my profiling of Qt Creator, qHash and the SHA-1 calculation
are the hottest spots remaining in QtCore. The current qHash function is
not really vectorizable. We could come up with a different algorithm
that is more SIMD-friendly, but since we have the CRC32 instruction that
can read 32- and 64-bit entities, we're set.

This commit also updates the benchmark for QHash and benchmarks both
the hashing function itself and the QHash class. The updated
benchmarks for the CRC32 on my machine shows that the hashing function
is *always* improved, but the hashing isn't always. In particular, the
current algorithm is better for the "numbers" case, for which the data
sample differs in very few bits. The new code is 33% slower for that
particular case.

On average, the improvement (including the "numbers" case) is:

 compared to          qHash only          QHash
Qt 5.0 function          2.54x            1.06x
Qt 4.x function          4.34x            1.34x
Java function            2.71x            1.11x

Test machine: Sandybridge Core i7-2620M @ 2.66 GHz with turbo disabled
for the benchmarks

Change-Id: Ia80b98c0e20d785816f7a7f6ddf40b4b302c7297
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-23 01:06:34 +01:00
Albert Astals Cid
8cf9811ec3 Do not overwrite basePixmap of QIconLoader PixmapEntry
Change-Id: I4799af1d9151ba4b0952369e9620d2fab2b002d9
Reviewed-by: David Sansome <me@davidsansome.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-01-22 16:32:34 +01:00
Tor Arne Vestbø
b2f8a70890 iOS: Enable building of basic tests
Allows us to sanity check the iOS build in the CI.

Change-Id: I16f9bfafef3988dcab6efd3155503ca0d0b4d1d8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-01-22 12:35:17 +01:00
Frederik Gladhorn
f3bf2efcbd Merge remote-tracking branch 'origin/release' into stable
Change-Id: I885821d93a41b0caad627bfc16aa8eed21d2f5b9
2014-01-22 11:36:01 +01:00
Jędrzej Nowacki
9a9e7a8215 Fix lack of deterministic behavior in moc.
Moc should check full scope of any related objects or
gadget when it constructs extra data.

Change-Id: Ibd1b607a389cd4e788c0916984464cd9103d9c59
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-22 08:27:50 +01:00
Orgad Shaneh
b5241296f8 QDir: Do not assume that root ends with a slash
Root can also be "//server"

Task-number: QTBUG-35402
Change-Id: I25250b7dcb10cba7b676a0c88b64a402494d7481
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-22 00:04:16 +01:00
Frederik Gladhorn
46791c08e1 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-01-21 17:57:54 +01:00
Kai Koehne
b8a38a6737 Allow printf style for qCDebug, qCWarning, qCCritical macros
Add support for using qCDebug and friends in the 'printf style' way.
This allows an almost mechanical conversion of existing qDebug, qWarning,
qCritical macros, and allows avoiding the size overhead the streaming
style incurs (mostly due to inlined QDebug code).

To handle this gracefully we require variadic macros (part of
C++11/C99). For compilers not supporting variadic macros we fall back
to checking the category in QMessageLogger.

[ChangeLog][QtCore][Logging] Allow qCDebug macros to be used in a printf
style.

Change-Id: I5a8fb135dca504e1d621bb67bf4b2a50c73d41b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 14:58:03 +01:00
Lars Knoll
9eba69d7f9 Fix a bug in some QString comparison operators
Some comparison operators comparing to const char *
where not implemented correctly.

Task-number: QTBUG-34024
Change-Id: Idbdc64c8ed93e88d9f2b2f55213bc785b33cb543
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-21 11:12:11 +01:00
Friedemann Kleint
afe3902a30 Testlib: Use QString for messages in QAbstractTestLogger::addMessage()
Task-number: QTBUG-35743

[ChangeLog][QtTest][Windows] Use correct UTF-8 encoding for XML test results on platforms with different console encoding.
Change-Id: Ice9d03192098f931e5dac358928e0c4421ab715e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-21 06:28:23 +01:00
Richard J. Moore
5c19fad8c1 Ensure weak ciphers are not part of the default SSL configuration.
Any cipher that is < 128 bits is excluded from the default SSL
configuration. These ciphers are still included in the list
of availableCiphers() and can be used by applications if required.
Calling QSslSocket::setDefaultCiphers(QSslSocket::availableCiphers())
will restore the old behavior.

Note that in doing so I spotted that calling defaultCiphers() before
doing other actions with SSL had an existing bug that I've addressed
as part of the change.

[ChangeLog][Important Behavior Changes] The default set of
ciphers used by QSslSocket has been changed to exclude ciphers that are
using key lengths smaller than 128 bits. These ciphers are still available
and can be enabled by applications if required.

Change-Id: If2241dda67b624e5febf788efa1369f38c6b1dba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 03:41:34 +01:00
Frederik Gladhorn
9033977d39 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/tools/qstring.cpp
	src/gui/image/image.pri
	src/gui/image/qimage.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
	tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp

Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
2014-01-20 18:18:59 +01:00
Jędrzej Nowacki
260b0b4ed6 Rename a test class to a bit more verbose name.
That way we can avoid name conflict with a namespace defined in
a different moc test

Change-Id: Id631d7c5556c9d6940e16dc53eb438dbcd0095eb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 17:08:28 +01:00
Jędrzej Nowacki
71d265f592 Add missing header guards
Change-Id: I515313289c0a4af0f675131760ad4ccd0c6e6149
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 17:08:24 +01:00
Christian Kandeler
bbee8ca485 Fix warning in QVariant test.
Values from different enums were compared.

Change-Id: I2faf73976e4b24abbdc915e8445256fe7a5be5bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-20 14:58:48 +01:00
Bartosz Brachaczek
7ffce3fb0b Fix cd(), cdUp() QDir member functions docs regarding nonreadable dirs
The documentation implies that cd() and cdUp() functions return false if
the new directory is not readable, but that is not the case. It is an
obvious mistake in the documentation, because cd'ing into a nonreadable
directory is perfectly valid.

Provided also with a test to verify that cd() actually returns true with
nonreadable directories.

Change-Id: I4aa3e859b35c64266df510a203574e3701aea77c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 12:20:45 +01:00
Volker Krause
ec77f93b38 Fix crash when constructing a QVector with an empty initializer list.
Data::allocate(0) returns a pointer to read-only memory, updating d->size
will segfault. The safety check for this exists in all other QVector ctors
already.

Change-Id: Ida0fe4182de56ee62c7f91e8652cfafbfd7b8410
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-18 11:16:40 +01:00
Friedemann Kleint
ab2c90cc52 Introduce function for standard button texts to QPlatformTheme.
Change-Id: I91eec04a95b5047d893490a70152237b2991f662
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-18 09:23:38 +01:00
Friedemann Kleint
d5912b2a47 Testlib/generate_expected_output.py: Fix encoding.
Do not apply additional encoding when reading process output.
Fixes errors when encountering UTF-8:

Traceback (most recent call last):
  File "./generate_expected_output.py", line 117, in <module>
    generateTestData(path)
  File "./generate_expected_output.py", line 106, in generateTestData
    out.write(data.decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 5485: ordinal not in range(128)

Change-Id: Ib827787a59a18b4d3d0601645856517f43c01fc3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-18 09:20:24 +01:00
Friedemann Kleint
f504287e80 Testlib/generate_expected_output.py: Pass tests as command line arguments.
Evaluate command line arguments and use directories only when empty.

Change-Id: I818ec13c686018a3f607e91174e57d8f8bbf15f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-18 09:19:38 +01:00
Andrew Knight
603eac2dfb d3dcompiler_qt: Place compiler options in the shader file name
The compiler service needs to know what options to pass to the compiler,
and these options can affect the outcome of the shader blob. Runtime
compiled shader output must match this file name in the binary directory.
Pre-compiled shader blobs (e.g. those placed in a resource file) are
permitted to drop options from the file name if the implementor can
ensure the blob is compatible with the target.

Defines are not written out as options, but written into the shader
source, and therefore affect the cache key.

Change-Id: I11e4a43fcf6818ddb29aca5eba3d8647ba4021a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-01-18 04:39:19 +01:00
Frederik Gladhorn
a69525243f Update test result generator script to set duration to 0
The actual code in testlib now indents the duration tag when it is for a
function.

Change-Id: Iee62db9c81f11dc54e57f166bf9fb2b7012b7e03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-18 04:39:17 +01:00
Kai Koehne
278152fffd Replace win32-g++ with mingw scope
Commit 773dd01 introduced a general mingw platform scope, which
is cleaner and more flexible than matching the spec name.

Change-Id: Ie3a9cb791a83f7c8a51bc4e23069190c452ab521
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-17 12:08:24 +01:00
Olivier Goffart
e59b28e08e QObject: fix connection to function pointer with non-copyable references argument
For example, QObject is non copyable (its copy constructor is deleted or
private via Q_DISABLE_COPY). It should still be allowed to pass a reference
to a QObject as an argument to as signal (or slot).
This fixes a compilation failure.

Task-number: QTBUG-36119
Change-Id: I9bcf477e347d69fdae2543c99781b6421883be78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-17 11:25:31 +01:00
Tor Arne Vestbø
04b8af2739 iOS: Fix compilation of some basic tests
The tests themselves may not actually pass, but it's a start, and allows
us to sanity-build a few things in the CI that actually produces a final
binary.

Change-Id: I02643b6ffa1522de1a7d17d737c8ab45ffac6a93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-17 11:04:43 +01:00
Olivier Goffart
55659fb5a4 moc: Fix parsing of complex defines defined via command line
Since now in Qt5 the moc does full macro substitution, it needs to handle
the defines passed is command argument, even if they span over multiple
tokens, or if they do not have any token.

Example:
 moc '-DCOMPLEX=QVector<int>' '-DEMPTY=' foo.h

[ChangeLog][moc] Fixed passing -D of a macro defined to something more
complex than a single identifier.

Task-number: QTBUG-33668
Change-Id: Ie8131de215f1659a24af4778d52ee40cda19759f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-17 01:36:37 +01:00
Richard J. Moore
7c8131763d Prevent spurious SSL errors from local certificates.
Qt since approximately 4.4 has set the verify callback on both the SSL
store and the SSL context. Only the latter is actually needed. This is
normally not a problem, but openssl prior to 1.0.2 uses the verify
code to find the intermediate certificates for any local certificate
that has been set which can lead to verification errors for the local
certificate to be emitted.

Task-number: QTBUG-33228
Task-number: QTBUG-7200
Task-number: QTBUG-24234
Change-Id: Ie4115e7f7faa1267ea9b807c01b1ed6604c4a16c
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-16 21:57:06 +01:00
Matt Broadstone
d6d7624796 Added constructor to QJsonValue for const char *
For convenience, it reads more easily (and is somewhat expected) to
be able to add a string to a QJsonArray like you might with a
QVariantList: QJsonArray() << "string". Previously, QJsonValue provided
a private void* ctor to explicitly deny this case because it would
implicitly convert to a boolean. This ctor provides a const char* ctor
(much like QVariant) that interprets the incoming text as utf8 and
creates a String type QJsonValue.

[ChangeLog][QtCore][QJsonValue] Added constructor to QJsonValue for const char *

Change-Id: Icafa954d3da1fb264f9d0fd7cd1a1d2fbbe15095
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-16 21:49:26 +01:00
Matt Broadstone
13806e6787 Added convenience methods to QJsonArray for appending QJsonValues
operators for +, +=, and << were added to QJsonArray to make
it easier to work with, and more closely resemble the Qt
container classes

[ChangeLog][QtCore][QJsonArray] Added convenience methods to QJsonArray for appending QJsonValues

Change-Id: I96e0a43015f7c0f980cbbef7f20bd2085ee04795
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-16 21:49:18 +01:00
Sergio Ahumada
73b5a5cdd5 test: Don't build qmimedatabase-cache for QNX
update-mime-database does not exist, so there is no point in
trying to build this test.

Change-Id: Id60f2f8fc3af33d3f7ae2fb4f1042356b60f6596
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
2014-01-16 16:11:04 +01:00
Christian Strømme
aa7ec3cdf5 Android: QStandardPaths implementation
Adds standard paths implementation for Android.

[ChangeLog][QtCore][QStandardPaths] Added
QStandardPaths implementation for Android.

Task-number: QTBUG-34631

Change-Id: I38673204a521a990438470c4e165105a2b02b7ad
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-16 02:38:11 +01:00
Peter Hartmann
e746aa6e93 network tests: add manual test for uploading images to Facebook
... to have a real world test case for uploading via SSL,
QHttpMultiPart (+ resetting) etc.

Change-Id: I004dd6f2507776b2fb8ebe1f02625b40abff6261
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-01-15 21:32:41 +01:00
Joerg Bornemann
5ca6039b77 remove qt_windows.h from qwinoverlappedionotifier_p.h
Preparation for making QWinOverlappedIoNotifier public.

Change-Id: Id443514a134b5c13e64d4d89450a7912ab38d40f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-15 18:43:20 +01:00
Gabriel de Dietrich
a813fcf470 Stabilize tst_QAbstractItemView::task200665_itemEntered()
It seems that sometimes QCursor::setPos() will not get the opportunity
to run the event loop before scrolling the list view unless we do it
explicitly.

Task-number: QTBUG-35060
Change-Id: Ic635bd8d1a4e3dbcadf9605e88197df6a0f69fc7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-15 18:34:28 +01:00
Sergio Ahumada
fa907401e9 test: tst_qhttpsocketengine requires `private_tests' set
Otherwise you get:

  undefined reference to `vtable for QAbstractSocketEngine'

when -developer-build is not used.

Change-Id: I444140736a6bf736894dc12a20f6a4d48af2678e
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-01-15 16:18:47 +01:00
Sergio Ahumada
f15d730589 test: tst_qhostinfo requires `private_tests' set
Otherwise you get:

  undefined reference to `qt_qhostinfo_clear_cache()'

Change-Id: I32313f290b9e4236440ae01afe12285d4539be60
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-01-15 16:18:44 +01:00
Friedemann Kleint
122ae7142b Stabilize tst_scrollbar.
- Use a separate widget for each test.
- Replace hard-coded timeouts by qWaitForWindowExposed.
- Center windows on screen.

Change-Id: I45ae306fd23348ee5dec3849e64ec98843e8bf32
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-14 22:33:19 +01:00
Konstantin Ritt
edfce46a6c Update the Unicode Data and Algorithms up to Unicode 6.3.0
* Mongolian and Phags-pa characters have been given a Joining_Type
  classification for contextual shaping. As a part of these additions,
  one Phags-pa character has the Joining_Type value of L (Left Joining),
  which no character had been assigned before.
* The unassigned code points in the Currency Symbols block have been
  given the Bidi_Class property value ET and the Line_Break property
  value PR, to help implementations support new currency symbols,
  when they are encoded.
* Hebrew letters and basic punctuation marks have been assigned
  the newly introduced Word_Break property values Hebrew_Letter,
  Single_Quote, and Double_Quote.
* The Bidi_Class property has been extended with four new values
  for directional isolates.
For more details, see http://www.unicode.org/versions/Unicode6.3.0/

Change-Id: Iad62d02edc58a8497898dcd6d6c70d5aece317ea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-14 15:38:57 +01:00
Konstantin Ritt
a6046be428 Update UCD source files up to Unicode 6.3.0
Change-Id: I9ab58a659af1e758b172a24aa95bce1fea89c33d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-14 15:38:43 +01:00
Thorbjørn Martsum
0e69230d02 Revert "QAIV - Fix scollbars with ScrollPerPixel to scroll 1 pixel."
This reverts commit 934f062203.

The patch needs to be modified a bit. Many users considers
not having the old feature as a big regression.

The feature needs to be improved with a variable that is
only set when the user uses setSingleStep.

Task-number: QTBUG-33906

Change-Id: I35e5d3e9d3d7a3ebd01807b03a0e7a424185d483
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-01-14 12:59:09 +01:00
Oswald Buddenhagen
882bf3475c expand tabs and related whitespace fixes in *.{cpp,h,qdoc}
the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-13 22:46:50 +01:00
Konstantin Ritt
4f8f0f16d0 Update the internal CLDR tables up to v.24
Change-Id: I9c0b110e36dd80c6a0b7275aa13bc548419aca9c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
2014-01-13 19:02:10 +01:00
Frederik Gladhorn
019588f307 Testlib: Add test duration to xml output
[ChangeLog][QtTest] Added test duration to xml output.
When running tests with xml output a new tag of the form
<duration msecs="123"/> is added to each test function and the test as a
whole.

Change-Id: Ibc4db066b6acf5fac6c578f5e5ca5ce4b5d8ea8e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-13 07:13:17 +01:00
John Layt
684ebc6648 QDate - Fix parsing Qt::ISODate
Fix parsing of ISO Date from being totally lenient to being semi-strict
by requiring the separator positions to be non-numeric.

[ChangeLog][Important Behavior Changes] Parsing of Qt::ISODate by
QDate::fromString() and QDateTime()::fromString() is not as lenient as
before, the date component separators are now required to be
non-numeric.  This means a string like "2000901901" will no longer be
recognized as a valid ISO Date, but "2000/01/01" will still be even
though it doesn't strictly meet the ISO format of "2000-01-01".

Task-number: QTBUG-34141
Change-Id: I0e481144136c60d4cac61364b9b2c1d2cd1e78fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-11 20:45:22 +01:00
John Layt
a41a5f6671 QDateTime - Fix isValid() if invalid QTimeZone
Explicitly check that the QTimeZone is valid before trying to use it.

Change-Id: Iec415a2cb07071502fe71ee5ac92a7657e818f99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-11 20:45:22 +01:00
Frederik Gladhorn
7917dfbf1c Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
2014-01-10 18:27:49 +01:00
Peter Hartmann
6fd205d579 network proxy tests: adapt proxy authentication to new server
The tests pass with the new test server image. Once we are using the
new test server we can remove the test for the host not found error.

Change-Id: Iac8ba6d8ce31b0865b33a003086aac0339afe338
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-01-10 17:14:29 +01:00
Thiago Macieira
9598448758 Remove #ifdef from outside test functions
It's usually a bad idea to surround slots or signals with #ifdef since
moc may not parse it the same way the compiler does.

Change-Id: I6a3623ed7cb9fbc1b966df9d60f71b7fdf91acfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-10 17:14:29 +01:00
Thiago Macieira
eaedc04d90 Autotest: Fix QDateTime failure if the test got run West of Greenwich
There was a comment about the test failing for max() because of an
overflow. That happens if you're at UTC or ahead of it (to the East of
the Prime Meridian), which is how this test usually gets run (UTC,
Europe/Oslo, Europe/Helsinki, Pacific/Auckland). But if you're behind
UTC (to the West of the Prime Meridian), then the overflow happens for
min().

Change-Id: Iebba49d1303e9f18f5038f5cf23c77bf83e5fd4b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-01-09 22:49:23 +01:00
Thiago Macieira
cd750c86d6 Use the new UTF-8 codec in QJsonDocument
The encoder is in qjsonwriter.cpp, which requires special handling for
ASCII due to the use of escape sequences. The decoder is in
qjsonparser.cpp, which only scan one character at a time.

As a side-effect, the JSON parser now reports the UTF-8 error in the
first character with error, instead of the last. This is probably what
should have been expected.

Change-Id: I52e5bc30d71466b6a36098b4150c61b2e385d8e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-09 22:34:54 +01:00
Thiago Macieira
8dd47e34b9 Add a new UTF-8 decoder, similar to the encoder we've just added
Like before, this is taken from the existing QUrl code and is optimized for
ASCII handling (for the same reasons). And like previously, make
QString::fromUtf8 use a stateless version of the codec, which is faster.

There's a small change in behavior in the decoding: we insert a U+FFFD for
each byte that cannot be decoded properly. Previously, it would "eat" all bad
high-bit bytes and replace them all with one single U+FFFD. Either behavior is
allowed by the UTF-8 specifications, even though this new behavior will cause
misalignment in the Bradley Kuhn sample UTF-8 text.

Change-Id: Ib1b1f0b4291293bab345acaf376e00204ed87565
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-09 22:34:54 +01:00
Christian Loose
955d0df873 Add option NoCancelButtonOnLastPage to QWizard
Add support to hide the cancel button on the last page of a wizard. This
is useful for wizards where the last page is used as a summary page that
should not be cancelled.

[ChangeLog][QtWidgets][QWizard] Added NoCancelButtonOnLastPage option.

Task-number: QTBUG-7484
Change-Id: I282bda55a8dec9cde6439a9285d79e0a5c6df96a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-01-09 21:03:25 +01:00
Jan Arve Saether
0efc6e92d8 Use the default height (not 0) if only width is specified
If width was specified, but not height (or vice versa) the actual
window size was not as expected:
* The window width was not the width specified.
* The window height became 0.
This was unexpected, since if both width and height was not specified
it would fallback to becoming 160x160 (on Windows).

However, with the advent of https://codereview.qt-project.org/71999
both width and height might receive sensible defaults based on the
content of the ApplicationWindow, which would mean that it might be
reasonable to expect that you only need to specify one size component
of the window.

This also fixes an assertion in file
..\..\..\3rdparty\angle\src\libGLESv2\renderer\SwapChain9.cpp, line 81
The assertion happened when a window was created with 0 height (but
valid width), and then its height got increased, causing it to become
visible.

Change-Id: Ia9e730418e35d679907bdcc59b00c3c988216c32
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-09 19:27:32 +01:00
hjk
48f1ebc040 Add QVarLengthArray::{indexOf,lastIndexOf,contains} functions
[ChangeLog][QtCore][QVarLengthArray] Added the indexOf, lastIndexOf and
contains functions to QVarLengthArray.  These functions make the class
more similar to QVector.

Change-Id: I9bd2b22bd8b7151c2d17aede36e5f2126570600b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-09 17:42:22 +01:00
Tomasz Olszak
3867bc5a10 Send DynamicPropertyChange event only when value is changed.
According to docs DynamicPropertyChange event should be sent from
setProperty function only when property is added, removed or
changed.

Change-Id: I080a27a4119a63580b03172f4b5b367338c6f440
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-09 12:14:42 +01:00
Allan Sandfeld Jensen
b28764c641 Inplace versions of QImage rgbSwapped() and mirrored() for rvalue refs
Adds inplace version of QImage::rgbSwapped() and QImage::mirrored() that
can be used on temporary QImage objects when supported by the compiler.

[ChangeLog][QtGui][QImage]Rvalue qualified mirrored and rgbSwapped methods for inline conversions
Change-Id: I4ffb658bf620dfc472d9db14c1aa70291c1fd842
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-08 18:08:47 +01:00
Frederik Gladhorn
8f80ff338e Make output when failing a test for diff in line numbers more verbose
Change-Id: I536ffddffe40f9f6bbcd75f312a5f902763e1131
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-07 19:21:45 +01:00
Frederik Gladhorn
15ff120b02 Update testlib selftest units
The units that were supposed to have variance were completely off in the
test leading to all benchmarks with slight variance being completely
flaky.

Change-Id: Ib76593813974adee462b3f03be9370d2248d770c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-07 19:21:34 +01:00
Frederik Gladhorn
8059541199 Stabilize one function in tst_qpauseanimation.cpp
Under load the timing may go wrong.

Change-Id: Iaa947fb9adcfccd2568337adbb17094996cce827
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-07 19:21:16 +01:00
Liang Qi
35f2a61426 QKeySequence: return Qt::Key_unknown with invalid modifiers on OS X
This also fixes the auto test, tst_QKeySequence::parseString() with
Win+A and Simon+G.

[ChangeLog][QtGui][OS X][QKeySequence] return Qt::Key_unknown with
invalid modifiers on OS X

Task-number: QTBUG-24406
Change-Id: Ie90393c9691f443c7c359cb3a487609a9691bc44
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-07 18:55:10 +01:00
Liang Qi
dbaff44ff1 test: fix tst_QPushButton::sizeHint() with Mac style on Mac OS X
The style name should be macintosh, not mac.

This also reverts commit 2f46ea9fd6.

Task-number: QTBUG-23680
Change-Id: I7fd06da165ca5bc99801c13af13fdb3d35119566
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-07 18:55:07 +01:00
Liang Qi
3b2143bdf7 Revert "Skip tst_QMenu::QTBUG_10735_crashWithDialog() on Mac OS X"
This test doesn't fail any more.

This reverts commit 6f21509ac0.

Task-number: QTBUG-23677
Change-Id: Idc094ce0c90b8d3ba0a75d93ccef8da4801605c7
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-07 18:55:04 +01:00
Laszlo Agocs
dcbb16a452 Add takeTexture() to QOpenGLFramebufferObject
Add an API that allows to retrieve and detach the texture from the
framebuffer object. The next bind() call will then create and attach a
new texture.

[ChangeLog][QtGui][QOpenGLFramebufferObject] Added takeTexture() for
retrieving and detaching the texture from the framebuffer object.

Task-number: QTBUG-35881
Change-Id: I2cca37f5872c1685b1238047f8b912e6534ab781
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-07 13:04:18 +01:00
Andrew Knight
a90972e8f8 WinRT: Enable accessibility by default
While there is no implementation for accessibility yet, enabling it allows
the interfaces to be used and an accessibility plugin to be developed
for this platform.

IAccessible2 and MSAA bridge autotests are disabled for this platform.

Change-Id: I2bfd07f6b21ca469b27d88ef11df723ac8ff8202
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-01-07 10:55:30 +01:00
Laszlo Agocs
bd5cea5ba8 Resurrect QGLWidget::renderPixmap()
This function has been completely broken since Qt 5.0. Unfortunately
the autotest's verification steps were somewhat faulty so returning
a null pixmap from renderPixmap() did not trigger a failure.

The implementation is now done with framebuffer objects and pixel
readback. This is not ideal performance-wise, but is the only option.
In Qt 4 pixmaps were often backed by platform dependent native pixmaps
that could be used as rendering targets for OpenGL content. This is not
an option anymore since pixmaps are raster backed on all the major platforms.

Task-number: QTBUG-33186
Change-Id: I8f558e33bf7967ac3be439fd5a3eac07b6444be5
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-06 12:57:20 +01:00
Frederik Gladhorn
a34f37cc71 Add a way to reproduce testlib selftest data
This makes testlib a lot more hackable since when the output is changed
in a defined way we can regenerate the expected output (eg adding the
test duration which will be a follow-up patch).

Note that the script does not work properly on Windows and not all
benchmarks work, but at least it reduces the work of adapting files to a few lines.

Change-Id: I910387cd92ff82aa629747a3a3033dae17fbd711
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-06 12:51:16 +01:00
Frederik Gladhorn
4d5906989a Update tests to normalizes the paths by using script.
The newly added generate_expected_output.py was used to get the expected
output into a more reproducible state.

Change-Id: I1ca75c8e0c5778d25c1df531bd298007aac0ff4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-06 12:50:47 +01:00
Liang Qi
bdd3ead827 OSX: support fake fullscreen and etc
* Fix QCocoaWindow::setGeometry() to respect WindowFrameInclusive
* Support fake fullscreen on 10.6 or WindowFullscreenButtonHint was not set on
10.7 and later
* Fix tst_qwindow on 10.6 and later

Task-number: QTBUG-23059
Task-number: QTBUG-34629
Change-Id: I6e032ca55b45674388b00506a424d3bd7ece429f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-03 15:27:38 +01:00
Simon Hausmann
b5ab7ee0d7 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
2014-01-03 14:30:21 +01:00
Frederik Gladhorn
954bb6c35f Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-12-24 10:25:50 +01:00
Simon Hausmann
2b287c7c21 Fix regression in property handling with enums from gadgets
When declaring a Q_PROPERTY(SomeType::SomeEnum foo ...) and SomeType is not a
QObject but a gadget, then we must still include SomeType's meta object in the
list of related meta objects.

Task-number: QTBUG-35657
Change-Id: I46195140cb5d180c4f03bb1fe06a876e3fe11267
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-24 08:10:16 +01:00
Jian Liang
8fcab70408 Avoid crash due to accessing deleted QWidgetWindow object
Change childWidget->windowHandle() to childWidget->internalWinId() in
q_createNativeChildrenAndSetParent() to determine whether should we call
childWidget->winId().
This is because in some circumstances Qt will crash due to accessing
deleted QWidgetWindow object if we use windowHandle(). Think about the
following scenario:

1) create a widget A without parent and add two child widgets B and C to A

2) create a native widget D as the child of B, note that when we set
Qt::WA_NativeWindow attribute to it, its QWidgetWindow will be created
which means its windowHandle() is not null.

3) create a top level widget E as the child of C and show it. This will
make Qt call createWinId() to A and then
q_createNativeChildrenAndSetParent() will be called to create A's native
children recursively and finally make D's QWidgetWindow object become a
child of A's QWidgetWindow object. Please note here that B will not become
a native widget just because at that moment windowHandle() of D is not
null and Qt will not call winId() to its parent B

4) Set A's parent to another widget which has been shown, setParent_sys()
will be called to A and then Qt will call destroy() to A. in destroy() Qt
will try to call destroy() to its children recursively with a condition that
the child has Qt::WA_NativeWindow been set. But D's parent B is not a native
widget right now so B and D is not destroyed. Qt will then deleted the
QWidgetWindow object of A, since E's QWidgetWindow object is a child of
A's QWidgetWindow object, it will also be deleted. Now E hold a deleted
pointer of QWidgetWindow object. This is the source of crash later.

Task-number: QTBUG-35600

Change-Id: I97a20a68e626ee62b15bb4eae580e26f8948923b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2013-12-24 02:56:41 +01:00
Frederik Gladhorn
f0fbff4c90 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
2013-12-24 00:56:59 +01:00
Simon Hausmann
d776937df9 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-12-23 22:44:13 +01:00
Marcel Krems
106316198d Enable QSqlError to handle alphanumeric error codes.
Some database systems (like PostgreSQL) use alphanumeric error codes.
Introduce a new method nativeErrorCode() which replaces number().
If the error code cannot be converted to int, number() will return 0.

Task-number: QTBUG-142
Change-Id: Ic7fba841737674b75c0c01c2263f51d2041da497
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-20 16:27:41 +01:00
David Faure
13c246ee11 QAbstractSocket: fix setReadBufferSize from readyRead slot.
In a slot connected to readyRead, if the app detects that the
buffer size is too small and increases it, it expects that
readyRead() will be emitted again.

setReadBufferSize() doesn't re-enable the socket notifier when
calling from within readyRead, and readyRead itself was missing
the code to do it.

Change-Id: Ia00a3066ad3ba09d5cfae0716adc5691ae96c3fa
Done-with: Thiago
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-12-20 09:30:05 +01:00
Andrew Knight
863810eb28 d3dcompiler_qt: Remove directory creation inside the proxy library
Use of mkpath/mkdir is removed in order to make the proxy less
invasive when there is no compiler service running. Creation of the
directory structure is fully the service's responsibility.
Service availability is now only checked once, at the first invocation of
D3DCompile, as it is expected to be started before the application.

Change-Id: Ib8c4f062c418497c2253daf524654e1db30dae47
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-19 21:23:48 +01:00
Thiago Macieira
68ff352906 Use the short time format of the current locale on Windows
Windows 7 and later have LOCALE_SSHORTTIME, which is what we need.

Task-number: QTBUG-33718
Change-Id: I4c3f113d17102a37fb752de56f06b312f27c7887
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-16 22:26:37 +01:00
Frederik Gladhorn
3f3be55835 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qplatformtheme.h
	tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
	tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp

Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
2013-12-16 16:59:33 +01:00
Frederik Gladhorn
f28ef6a308 Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-12-16 15:35:30 +01:00
Israel Lins Albuquerque
5193c14536 fix parsing of bound SQL statements for PostgreSQL
PostgreSQL allows bound variables inside square braces.

Task-number: QTBUG-34541

Change-Id: I4f069b3f1078d4cdf172fbac9e0d7d23d20d167a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-16 15:35:30 +01:00
Peter Hartmann
ae293c1cb2 QNetworkCookie: allow cookies for IPv6 domains
For IPv6 addresses don't call toAce as it returns the empty string.
We should reflect the behavior of browsers here, which all accept
cookies from IPv6 addresses.

Original-patch-by: David Tapuska <dtapuska@blackberry.com>

Task-number: QTBUG-35022

Change-Id: Ic00369e923d044ec459822b2405865c13e4185b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-12-13 09:44:25 +01:00
Peter Hartmann
746dddeb9f QNetworkCookie: allow cookies for IPv4 domains
If the domain is an IP address, we should not do any magic regarding
leading dots etc.

Task-number: QTBUG-35022

Change-Id: I7722de4e6027666dde27e9e37b6353e3da775d94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-12-13 09:44:13 +01:00
Thiago Macieira
ee7536876c Add the UTF16-to-Latin1 in-place converter
This is only possible for two important reasons:

1) QString and QByteArray d pointers are both done with QArrayData and
   that class does not care that the alignof(T) changes from 2 to 1,
   so we can give the pointer from QString to QByteArray
   (after adapting the allocated size, which is now double)

2) conversion from UTF16 to Latin1 always has fewer bytes (exactly half)

Change-Id: I17b2690c910f3de8db55156c6d6b5f55be06d827
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-13 09:30:04 +01:00
Friedemann Kleint
c0b899b3df tst_qlinedit: Create a new test widget on demand for each test.
The test used a member testWidget that was cleared and reset after each
test, which caused focus fights and side effects. The widget is now
created and shown only when necessary.

Change-Id: I0dc635e9d4cdf4f899994b88206bb0125526f6df
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-12-12 23:21:21 +01:00
Simon Hausmann
54f0733e7d Fix erroneous exclusion of classes from related meta objects in moc
Assume an unrelated class that declares an enum and uses Q_ENUMS. Consider
then a class that uses UnrelatedClass::Enum as a Q_PROPERTY. We used to
include UnrelatedClass in the primary class's related meta objects, in order
to support use-cases like
    obj->setProperty("enumProperty", "ValueOfEnumAsString");

If however moc happens to see Q_DECLARE_METATYPE(UnrelatedClass::Enum), then it
would exclude it from the related meta objects, which would silently break the
string based enum value conversion. This was meant as an optimization, but it
isn't apparent to the developer why sometimes the string conversion would
work and sometimes not (depending on whether somebody declares that macro).
This also becomes visible in QML, which relies on the same embedded type
information for enum assignments.

This patch removes that check in moc's code generator and cleans up the code a
little. However always including the prefix of Q_PROPERTY(SomePrefix::Enum ...)
is not correct either, because it may be that SomePrefix is a namespace, which
would cause compilation issues. Therefore we limit the inclusion of related
meta objects only to Q_OBJECT decorated classes the moc has seen, and for these
we save the fully qualified name in the related meta objects array (for QTBUG-2151).

While this patch makes the previous workaround for namespace issues by using a
Q_DECLARE_METATYPE not workable anymore, by saving the fully qualified name we
are making a hopefully sufficient effort to not require a workaround in the
first place. There's always the new workaround of fully qualifying the type in
Q_PROPERTY.

One side-effect of this change is that in the autoPropertyMetaTypeRegistration
test of tst_moc, the CustomQObject for Q_PROPERTY(CustomQObject::Number
enumValue ...) is now a related meta object, and therefore when querying for
the type of this property via QMetaProperty::userType(), we are now aware of
this being an enum and try to resolve CustomQObject::Number via
QMetaType::type(qualfiedName). As there is no guarantee for this to succeed, we
must now also do what is done in the non-enum code path in ::userType(), which
is to call the moc generated type registration function.

Task-number: QTBUG-33577
Task-number: QTBUG-2151
Change-Id: Ibf20e7421cba464c558a25c76a7e1eef002c6cff
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-12 22:57:19 +01:00
Frederik Gladhorn
63611cff87 Merge remote-tracking branch 'origin/release' into stable
Change-Id: I0cd3b1b33e6d9bec729d941b06aeeb3d21851820
2013-12-12 18:01:28 +01:00
ABBAPOH
4d8a12904a Check if device is opened before trying to create image handler.
Change-Id: I60f1f6890fdd73e489da4aab9928370163f55f58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-12-12 12:02:29 +01:00
J-P Nurmi
a2666d3391 QLineEdit: hide placeholder text when h-centered & focused
[ChangeLog][QtWidgets][QLineEdit] A blinking cursor in the middle
over horizontally centered placeholder text looks bad. Thus,
horizontally centered content is now considered as an exception
and the placeholder text is hidden when the line edit is focused.

Task-number: QTBUG-31669
Change-Id: I17aa1e6656673f81545a8437f90814b188ad484a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-12-11 19:21:27 +01:00
Marc Mutz
75df151eaa tst_QObject: separate QSignalBlocker tests
tst_QObject is getting big, so make a separate test for QSignalBlocker,
but leave parts of signalsBlocked() in tst_QObject as that seemed to
have been the only check for blockSignals(true) actually blocking signal
emission.

Change-Id: I1cfac035e0e39203eea8626d43f316cc6244ee86
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-11 10:05:07 +01:00
Marc Mutz
4031cb8610 Move-enable QSignalBlocker
When QSignalBlocker was reviewed, move semantics were asked for.
This patch add them.

This makes QSignalBlocker usable as a by-value argument (to transfer
control of signal blocking into a function) as well as as a return
value (to transfer control of signal blocking out of a function).

Change-Id: I714aa2a283bb33dba76e860649e88ed202e913c5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-11 10:04:48 +01:00
Marc Mutz
7fef5fe293 Stabilize tst_qabstractitemview
Attempt to fix

 FAIL! : tst_QAbstractItemView::task200665_itemEntered() Compared values are not the same
    Actual (spy.count()): 0
    Expected (1) : 1
    Loc: [tst_qabstractitemview.cpp(1292)]

which might have been introduced by removing the absolute qWait(200) in favor
of qWaitForWindowExposed() in afe8e368, so trying to compensate with a
QTRY_COMPARE.

Change-Id: Id437acd810b54e005daaf66ffffd4dd586075ab6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-11 09:55:39 +01:00
Joerg Bornemann
7009843ae3 QProcess/Win: allow child processes to change modes of the stdin pipe
To be able to call SetNamedPipeHandleState on stdin in a child
process, we must create a read-end pipe handle with the
FILE_WRITE_ATTRIBUTES flag set.
This can't be done with CreateNamedPipe but only with CreateFile.
Therefore we're creating the handles for the child process always
with CreateFile now. Besides, it's conceptually cleaner to have the
server handle of the named pipe in the calling process.

[ChangeLog][QtCore][Windows] Fix regression from Qt4 in QProcess.
It wasn't possible anymore to alter pipe modes of stdin in child
processes.

Task-number: QTBUG-35357

Change-Id: I85f09753d0c924bdc8a6cef1ea5dbe6b2299c604
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-12-10 18:36:25 +01:00
Michael Brasser
16a26931d4 Allow the platform to specify a press and hold delay.
Press and hold is an interaction available on many platforms,
particularly when touch is involved. In Qt Quick this is exposed to the
user via MouseArea::onPressAndHold. This value should not be hard-coded,
but rather use a platform-specified default. This commit adds the
low-level hooks necessary for that to happen.

Task-number: QTBUG-24793
Change-Id: I621a8ac9de66b881e34336228056bffbb6306a70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-12-10 17:36:05 +01:00
Peter Hartmann
aa3eaf9d2e QUdpSocket auto test: disable Socks5 over UDP for new test server
... because they fail on the new test server. This commit can be
reverted once the Socks5 socket engine is fixed.

Task-number: QTBUG-35490
Change-Id: I85635d4b44d26168d40a56b7a121693297564f0f
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-12-10 15:14:22 +01:00
Peter Hartmann
7eecbb0718 SSL: blacklist ANSSI intermediate certificate
... because it was used to operate a man-in-the-middle proxy.

Task-number: QTBUG-35474
Change-Id: Ic7f19708b278b866e4f06533cbd84e0ff43357e9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-12-10 15:14:22 +01:00
Friedemann Kleint
1171175a56 Add QFileDialog::ShowDirsOnly to manual dialog test.
Task-number: QTBUG-35396

Change-Id: I6ccb59d6bd3857aea66911e03200f28d093e57b4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-12-10 15:14:22 +01:00
Joerg Bornemann
29b0a565e9 fix Windows CE comments
Change-Id: Ib42c456c236f59727dddd6a111dfe0946fff1aef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-09 11:57:53 +01:00
Marc Mutz
7e2c9a9c62 moc: move qt_meta_extradata data from .data.rel into .data.rel.ro
It's still a relocation, but at least it can be marked read-only
after the relocation run, if indeed the dynamic linker goes to
such a length.

Change-Id: Ibadddac3ab99d2e58cc32cfd57311bddd3bdb0ef
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-12-09 10:30:05 +01:00
Andrew Knight
be2efef7a4 Introducing d3dcompiler_qt
d3dcompiler_qt is a DLL for use with ANGLE which replaces d3dcompiler_XX
at runtime to proxy shader compilation calls. This is useful for:
 - Loading the newest D3D compiler DLL found, instead of loading the
   version specified when Qt was compiled
 - Reporting better debug information when the compiler cannot be loaded
 - Caching shader blobs for later use
 - Returning cached shader blobs
 - Deferring compilation to another mechanism, such as a D3D compilation
   service running on a host debugging machine *

The above use cases are especially important for Windows Store apps, as
they are not allowed to ship the d3dcompiler. On Windows Phone, where
there is no runtime compiler, this is essential for handling QtQuick apps
which require runtime shader compilation.

* This requires a separate service which monitors a directory for shader
source files, compiles these files into D3D bytecode, and places
the bytecode in the qtd3dcompiler cache directory. This directory is
monitored by qtd3dcompiler, which is then able to then load the blob.

Change-Id: I9889c8d66d2ddbe5a7a1dc44bfe5d8ad229b0e43
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-09 10:27:28 +01:00
Simon Hausmann
25b390256b Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-12-09 10:13:48 +01:00
Simon Hausmann
105d10dea9 Fix quadratic behavior in QMetaObjectBuilder when writing string table
QHash::key() is O(n) and we're calling it n times. That can make repeated
calls to the meta object builder very slow, as for example QQmlPropertyMap
when inserting properties repeatedly.

Fortunately this is easy to fix, as the value in the hash map is also the
index, so we can simply iterate over the hash once. With the exception of
the class name, which we have to treat specially to ensure that it is always
the first entry in the string table.

Task-number: QTBUG-32720
Change-Id: Ic954c45c454107feee83216131f601cc69d4c63b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-06 18:18:44 +01:00
Oliver Wolff
1efe5d4b41 WinRT: Fixed compilation of network autotests and benchmarks
Change-Id: Id689f199cfb22dce231cec36faba57ab958b1bac
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2013-12-06 15:06:47 +01:00
Sérgio Martins
0c936ca83c Windows: Don't cover the taskbar when maximizing frameless windows
Brings Windows QPA on par with other platforms.

[ChangeLog][Windows] Don't cover the taskbar when maximizing
frameless windows.

Task-number: QTBUG-8361
Change-Id: Iba35132f697cb7379650a4c883b616c5c2023d4c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-06 13:52:34 +01:00
Kai Koehne
326e9c8962 Remove trailing space from QDebug stream
It's unexpected that all messages generated by the stream version
of qDebug and friends have a trailing space. It also makes switching
to categorized logging (which only supports the stream version) difficult,
since all autotests checking for debug output would have to be adapted.

Task-number: QTBUG-15256
Change-Id: I8d627a8379dc273d9689f5611184f03607b73823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-12-06 13:33:10 +01:00
Friedemann Kleint
7cfe7c1982 Windows command line parsing: Do escape backslash.
This will break network paths passed as command line arguments.

Introduced by 4ff6951550 .

Task-number: QTBUG-35432
Task-number: QTBUG-30628

Change-Id: Ice9ce15275ef69e9e9e82daf5a303e7c56294368
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-12-06 11:32:10 +01:00
Marc Mutz
03affacaa3 QCommandLineParser: pluck some low-hanging fruit re: exception safety
Make
  QCommandLineParser::add{Help,Version}Option()
  QCommandLineOption::setDefaultValue()
  QCommandLineOptionPrivate::setNames()
have transaction semantics: either they succeed, or they change nothing.
It's trivial to provide this guarantee, so do it.

Add a test for the surprising property that setDefaultValue("") resets
defaultValues() to an empty QStringList instead of one that contains
the empty string.

Change-Id: I61623019de3c7d2e52c24f42cc2e23ec5fddc4da
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-12-06 08:44:31 +01:00
John Layt
689152e7c1 QTimeZone: Fix isValidId()
Fix isValidId() which was failing valid IDs because it was splitting
name parts by \ instead of /.  it was also rejecting offset from UTC
formats names.  Add unit tests.

Task-number: QTBUG-35025
Change-Id: I4d23d2e54f4a9fac9afcc4eff0a02d6f4af21385
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-12-06 01:36:09 +01:00
Mitch Curtis
b9c8073230 QSpinBox: allow positive values to be entered with the '+' prefix.
The code was there to do it, but it was using minimumValue instead of
maximumValue to test if the '+' should be allowed.

Task-number: QTBUG-20691

[ChangeLog][QtWidgets][QSpinBox] Entering positive values with the '+'
prefix is now allowed.

Change-Id: Iff62d073e350dc9a33b7e06e4b492048c74437c4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-12-05 23:57:53 +01:00
Frederik Gladhorn
af47adede0 Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-12-05 19:53:16 +01:00
Frederik Gladhorn
f6dbdd9c16 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/sql/drivers/sqlite/qsql_sqlite.cpp

Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
2013-12-05 18:52:38 +01:00
Frederik Gladhorn
733ace5a7a Merge remote-tracking branch 'origin/release' into stable
Conflicts:
	configure
	mkspecs/macx-ios-clang/features/default_post.prf
	tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp

Change-Id: Iaba97eed2272bccf54289640b8197d40e22f7bf5
2013-12-05 17:42:33 +01:00
Jan Arve Saether
6c322a917a Add proper abstractions to the grid layout engine.
The abstractions are needed so that they can work with both
QGraphicsLayouts and QtQuick.Layouts.

Since the plan is to move the engine to QtGui, this means that the
engine cannot have any references to anything in the QtWidgets module.

As a consequence of that several things had to be done:
* The style info object had to be redone with an abstraction layer
  to get rid of style and widget dependency. (Abstract class is
  called QAbstractLayoutStyleInfo)
* QGridLayoutEngine must be subclassed due to some specializations for
  QGraphicsLayoutItem, manifested as QGraphicsGridLayoutEngine.
* QGridLayoutItem must be subclassed due to some specializations for
  QGraphicsLayoutItem, manifested as QGraphicsGridLayoutEngineItem.

Did also some minor cleanups, reordered arguments so that all styleInfo
arguments are last in all function calls

This also fixes QTBUG-35099 (bug was spotted during this refactoring)

Task-number: QTBUG-35099

Change-Id: If49d40f71870dc8d99d2e145be158e3080b595fa
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-12-05 17:20:35 +01:00
David Faure
d270bd8673 QTextEngine: fix layouting of inline objects in right-aligned tabs.
(same thing for center- and delimiter-aligned tabs)

The width of the inline object wasn't taken into account, the code in
QTextEngine::calculateTabWidth only looked at glyph widths.

Change-Id: I303a6561c67870ff2094a685698e642fc1b53b12
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2013-12-05 16:40:06 +01:00
Morten Johan Sørvig
1983bc9c37 Make layoutDirection pass with new expose behavior
A QMenu with no actions gets a size of (0, 0) on OS X.
With the new stricter expose event behavior this
is considered invalid geometry and the platform plugin
won't send an expose event, causing the qWaitForWindowExposed
test to fail.

Add a menu entry since the layoutDirection test is
not really interested in testing the special case of
empty menus.

Change-Id: I5221dc3f0472ac13edf821df08bacc3a4eb5cd9d
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-12-04 14:48:12 +01:00
Mitch Curtis
3e549f5daa QComboBox: fix keyboard selection with multiple character strings.
Take longer search strings into account instead of just using the first
character of the search string.

Touches up https://qt.gitorious.org/qt/qt/merge_requests/1418 for
resubmission.

Task-number: QTBUG-3032

[ChangeLog][QtWidgets][QSpinBox] Fixed keyboard selection with
multiple-character strings.

Change-Id: I2f68c8b97b1a1884659dcb19f52b1efeace9b88b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-12-04 13:19:57 +01:00
Kai Koehne
5da094c1aa TestLib: Ignore trailing space in QTest::ignoreMessage
When comparing expected with actual debug messages, allow the expected
ones to contain a trailing space. This is needed to not break all
autotests in a follow up patch, which will prevent ~QDebug() from
generating a trailing space by default.

Task-number: QTBUG-15256
Change-Id: I7f67393ddfbfe37fde1ca5ef45e4ad7f4b5324b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-12-04 13:10:49 +01:00
Nikolai Kosjar
9302169bd5 QtConcurrent: Workaround GCC bug 58800 in median calculation
1) Revert 880b614 for libstdc++ <= 4.7.3 || (4.8.0 >= ... <= 4.8.2)
2) Fix off-by-one error in reverted code for Median::_bufferSize <= 2.

Task-number: QTBUG-35058
Change-Id: I9d226c2806c1cf06c3d5b9c9f371262d2d69bf2b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-12-03 11:45:18 +01:00
Marc Mutz
c70750f536 Stabilize tst_QGraphicsItem
The cursor() test was missing a QTest::moveMouse() before sending of the
mouse event (as all the following subtests do). When run on a desktop with
the panel on the left side of the screen, the mouse pointer would land over
the left item instead of in between them, as assumed by the subtest, and
the following QCOMPARE failed.

Change-Id: Ib74fdf0cfbfbc8ecb79a906610a2da5cb50c89d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-03 11:42:13 +01:00
Friedemann Kleint
d1f9f2125e Stabilize tst_QColumnView::dynamicModelChanges().
Use QTest::qWaitForWindowExposed() and QTRY_COMPARE() instead of
hardcoded timeout.

Task-number: QTBUG-35308
Change-Id: I27eee9932dd3b6087db4ad13b1a4fb184a487f57
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-12-03 11:40:57 +01:00
Tasuku Suzuki
c3c424b384 QSqlQuery::isNull string overload
Introduce isNull overload to take field name as a parameter.

This is corresponding to the commit
7e6e141234

Change-Id: I122f79707d26eaa09c2f38dc31aeee1dac7de33b
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-01 23:14:15 +01:00
Frederik Gladhorn
777cdb00e7 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ibb342cc5fc55ff9a3f4b3ecbd53936b57bc13e63
2013-11-29 15:59:34 +01:00
John Layt
e8a45152b5 QPrinter - Fix OutputFormat when no printers
Currently the QPrinter constructor, setOutputFormat() and
setPrinterName() make bad assumptions about the availability of printers
when configuring NativeFormat which can lead to inconsistent print
engine set-ups leading to crashes in the print dialog, especially on
Windows where a valid DEVMODE is needed.

This change cleans up the init and methods to ensure NativeFormat can
only ever be set if we have both a valid plugin and a valid printer,
if not the PdfFormat is used.  One side-effect of this is that it is
now impossible to set an invalid printer name via QPrinter (but still
able to be done via QPrintEngine if really needed).  Also if no
default printer is set then use the first available one.

This also fixes a bug where setting a new printer name on Windows
reset all the saved settings.

[ChangeLog][Important Behavior Changes] QPrinter no longer allows you
to set an invalid printer name.

Task-number: QTBUG-34345
Task-number: QTBUG-26008
Task-number: QTBUG-26430
Change-Id: I19737e4209d8c8df5817ea83246b3dd0c483ee85
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-11-29 15:59:00 +01:00
Simon Hausmann
8e04691543 Merge remote-tracking branch 'origin/release' into stable
Change-Id: I2e2bf789b0fe8442ed623bc0c8aef591235cdabe
2013-11-29 11:38:28 +01:00
Simon Hausmann
7c029e83a3 Fix invalid memory read when shutting down QML applications
As the last line in the QObject destructor, we call setParentHelper(0) to
remove ourselves from the parent. In the process of that we also initiate the
QML parentChanged callback. The first thing that parentChanged callback used to
do (but now does it too late, after 26350b5ceafa0ade1328037f6234a7d288eb8f48 in
qtdeclarative) is to check if the object was deleted and then return. We could
re-introduce the check there, but I think it's cleaner to not bother calling
the callback on a dead object in the first place.

Change-Id: Ia4d43b65a9b3744a451b4c312a2d6f9c0e3b67dc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-29 09:54:47 +01:00
Konstantin Ritt
ad684ff2a7 Add QSystemSemaphore::release() auto-tests
Change-Id: I4c48f9ad8c60307e4b922d6a6b82e03e455f14d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-11-28 20:33:56 +01:00
Konstantin Ritt
ed9e954f4b QSystemSemaphore: Clear error after successful operation
Change-Id: I5c1021b2329439e3aefaa1c0d9c0b8a298d285de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-28 16:54:22 +01:00
Jan Arve Saether
66b7e7497c Add test for default (style dependent) spacings
Task-number: QTBUG-35099
Change-Id: If19d3ccf7177dcbecef30b3ba1e16b022a3d54c4
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-11-28 15:29:44 +01:00
David Faure
1c046369e3 tst_qthreadpool: fix memory leak
Task-number: QTBUG-22673
Change-Id: I2e554a2ad0119b5f9ce2d36e4720538af5ef6b82
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-28 09:14:11 +01:00