Commit Graph

5835 Commits

Author SHA1 Message Date
Tor Arne Vestbø
8fe016158f iOS: Skip tests that don't make sense or don't work on the platform
Change-Id: Id6777bdf430ad8a8e3b432caf5000bea8f7860b6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-03-16 14:25:27 +00:00
Erik Verbruggen
8e12367a94 QStateMachine: add objectName to objects to ease debugging.
Change-Id: I3c495cc5bd04c0cac24d4abf827d6acfb35b8433
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-16 12:55:00 +00:00
Erik Verbruggen
cd4fbead3b QStateMachine: fix warnings in test.
- removed an unused field
- initialized variable that might be used uninitialized.

Change-Id: I7a7a063f025ecc32fa462dd8d5e2485c2ba52eb8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-16 12:54:54 +00:00
Marko Kangas
bc69fd1dfe Skip instead of entirely excluding tests with disabled features
Properly QSKIP tests that use disabled QProcess and symlink
features instead of excluding them silently by #ifdef.
Other reason is that moc doesn't respect QT_NO_* defines
in class definition which causes build issues on some
platforms.

Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2015-03-16 09:34:15 +00:00
Simon Hausmann
198606f6db Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/plugins/platforms/xcb/qxcbnativeinterface.cpp
	src/plugins/platforms/xcb/qxcbnativeinterface.h

Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
2015-03-16 10:31:07 +01:00
Thiago Macieira
97f489e7b9 Network tests: don't try to test against disabled network interfaces
Other parts of tst_qudpsocket.cpp already did this check.

Change-Id: Iee8cbc07c4434ce9b560ffff13ca545a03c9596a
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-16 05:30:44 +00:00
Alberto Mardegan
748abf9347 Add QDBusMessage::createTargetedSignal()
The QDBusMessage::createSignal() static method doesn't take a parameter
for specifying the destination service of the signal. While this is not
a widely used feature, it can be useful to avoid waking up all connected
clients when the service knows what are the clients which are interested
in the signal.

This commit adds a QDBusMessage::createTargetedSignal() method which
also takes the destination service as its first parameter.

Change-Id: I9fdca53673a6944c39c93c1efd69a9d02859684e
Task-number: QTBUG-44704
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-14 19:01:49 +00:00
Rafael Roquetto
00c09aaf5b Fix build of tests on QNX.
Change-Id: Ib28e42e3eb10e26555fe392c55534f715bee5f8b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-14 07:05:34 +00:00
Thiago Macieira
61929c30fc tst_QUrl: Add extra testcases
Task-number: QTBUG-44921
Task-number: QTBUG-44920
Change-Id: Iee8cbc07c4434ce9b560ffff13ca303803916c2d
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-14 01:15:05 +00:00
Boris Dušek
62bcb1f4ba OS X Accessibility: Make checkboxes etc. checkable with VoiceOver
NSAccessibility has no explicit analog for
QAccessibleActionInterface::toggleAction(), checking checkboxes/radio
buttons is handled by NSAccessibilityPressAction. So ensure exposing
the action properly on OS X so that VoiceOver users can check/uncheck
checkboxes, select radio buttons etc.

Change-Id: I54b47515cc4882ecf0544c7351bd3c9046023a44
Task-number: QTBUG-44852
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-13 15:54:44 +00:00
Friedemann Kleint
3994ea1979 Add a verbosity setting to QDebug.
Add setters for an int verbosity to QDebug. The streaming operators
can check on the setting and output more information accordingly.

[ChangeLog][QtCore][QDebug] How verbose a single debug output should be
can now be fine-tuned by setting a verbosity on the debug stream.

Change-Id: I77001fcf1ef090a580d1a137bb5a667fc1bf1e1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-13 13:24:36 +00:00
Allan Sandfeld Jensen
fd6a2d1c8f Improve rounding in QCosmeticStroker
Fixes the drawn position of end points in drawLine.

Based on a patch by Jørgen Lind, and modified so that
it caused no test regressions.

Task-number: QTBUG-38144
Change-Id: I24aa28480cc6ae09abf91d80378970565a29b254
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-12 13:27:10 +00:00
Tobias Koenig
8f27586b1e Haiku: Fix tst_qfileselector.cpp unit test
Add the missing test data for haiku platform selector
and adapt unit test to use them.

Change-Id: I578e7f7e04f2a4c68f23d5356ea201e9562dbe6c
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-12 12:51:20 +00:00
Morten Johan Sørvig
10126b37d2 Cocoa: Correct mouse event forwarding for popups
We need to track the active popup globally, having
parent windows track child popups is not sufficient
since there may be one or more intermediate windows
in between the event receiving window and popup window.

Add API to QOCocoaIntegration for tracking the global
popup window and use it instead of the per-window
tracking. Make sure to only close popups on clicks
outside the popup only. Add code to QNSView::handleMouseEvent
that redirects mouse events to the active popup.

Add manual test.

Change-Id: Ia3e3fd42d8fddf5c69f0c6879b333ca544521f61
Task-number: QTBUG-43464
Task-number: QTBUG-31937
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-12 09:32:17 +00:00
Alex Trotsenko
9dd0bb851b Make QRingBuffer a 64-bit safe
According to I/O API, QIODevice and its inherited classes should be
able to process a full 64-bit offsets and lengths. This requires
64-bit parameters in operations with internal buffers. Rework
QRingBuffer to avoid implicit truncation of numbers and fix some
64-bit issues in code.

Change-Id: Iadd6fd5fefd2d64e6c084e2feebb4dc2d6df66de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-12 05:33:20 +00:00
Friedemann Kleint
5930a2d314 Track modifications of white space in QString::simplified().
The existing check fails to detect the case where white space characters
other than the space character are replaced by space characters
without the length actually changing and returns the original string.

Task-number: QTBUG-44936
Change-Id: Ice6faa975f8b41f185c76f6d0d4ff81603e25eb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-12 05:32:41 +00:00
Tor Arne Vestbø
c286afee3a tst_QWindow::initialSize: Use showNormal() instead of show()
On some platforms show() may result in the window being shown full
screen, depending on the defaultWindowState of the platform. If
that's the case, the resulting window size does not follow
the requested size (though the internal normal geometry should).

We need to use showNormal, so that we guarantee that the window
state is WindowNoState.

Change-Id: Ied080eaca13d759501ea292b5e6b2df4e3b32426
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-12 00:10:27 +00:00
Olivier Goffart
2d5210a684 tst_qvariant: Remove an obsolete QSKIP
The QSkip was there because of a bug in QList.
Since commit 8153386397, the test is
no longer using QList. We can remove the QSKIP

Task-number: QTBUG-8959
Change-Id: Icc18d341d734d0605dcddaf925586f3bd603d6a0
Reviewed-by: Jocelyn Turcotte (Woboq GmbH) <jturcotte@woboq.com>
2015-03-11 10:59:46 +00:00
André Klitzing
cacae82a70 CMake: Fix regression with quoted OPTIONS parameter
If a parameter contains quotes the check for "-binary" fails.

Change-Id: I27148b590d85291a93f1992dfd277fb857bec6e2
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2015-03-11 07:31:33 +00:00
Thiago Macieira
6272f01617 tst_QDateTime: remove silly test for timezone date too early
Let's not try to to compare our QTimeZone handling with the system one.
Our handling goes beyond the range of the POSIX APIs, so that's a recipe
for error.

Change-Id: Iee8cbc07c4434ce9b560ffff13ca4a4f335bdbae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-11 07:23:21 +00:00
Thiago Macieira
d3f6249de3 tst_QDateTime: Mark more Windows incorrect transitions
The refactoring from a8c74ddcf7 commit
exposed more issues in the Windows API. There were already quite a few
QEXPECT_FAIL for this, so this isn't new.

For example, localtime(1351386000) on the Central European Timezone
should be "Sun Oct 28 02:00:00 CET 2012" (the second occurrence of 2
am), but the Windows API returns tm_isdst = 1 (i.e., still in the CEST
timezone) and that's incorrect.

Change-Id: I1bc63ac99b1d67b55d783f9606e5c59b24223b13
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 07:00:24 +00:00
Frederik Gladhorn
3dbb526329 Fix regression in time zone handling
In QtScript we use the msecs since epoch conversion (JS date is based on
the concept). After a8c74ddcf7 the date
conversion test in qtscript started to fail. Instead of relying on the
code working by chance, simply update the date when setting it with
setMSecsSinceEpoch.

Task-number: QTBUG-44885
Change-Id: I9f95c9cdccea52e7d1f808f3cb9e18570ef0df13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-11 01:50:08 +00:00
Allan Sandfeld Jensen
e2c91dd77b Introduce QRgba64 structure for 64bit RGBA values
This structure is meant to replace QRgb where higher precision is
needed.

Change-Id: I49d441e2133371a8b91c2e6af0c137bcc5fcb9ed
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-10 12:27:54 +00:00
Eike Ziller
416438c2f3 QMimeDatabase: Fix magic rules with \t
\t was not interpreted as a tab character.

Task-number: QTBUG-44884
Change-Id: I3c733e227fba7e5fd5153df0ae4d0431903bb104
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2015-03-10 12:17:32 +00:00
Frederik Gladhorn
971b8413f2 QAbstractButton: emit released on focus out or disable
When pressing a button with the mouse and then moving the focus away,
the internal and visual state of the button would get updated, but the
released signal would not be emitted.
The same goes for disabling the button, although in 99% of the cases,
disabling the button will also move the focus, so the first case
already takes care of emitting the signal.

Task-number: QTBUG-42775
Change-Id: Ib6ba8e0a75f0349b66d1e799b02bd8498db85022
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-10 11:35:32 +00:00
Boris Dušek
395e205f2f Add string range tests to qaccessibilitymac
Change-Id: Ie01b12639057b5b9092531b74948d47f2b080a3d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-10 10:52:11 +00:00
Boris Dušek
672841b42f Refactoring of qaccessibilitymac test
In order to support testing values of more accessibility attributes
and parameterized attributed, we provided some "infrastructure" to be
able to query them with minimal effort. We also reworked current 6
supported attributes to use this new way.

Change-Id: Iece670fa9a862f84389466587c1595466eeedc7f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-10 10:51:56 +00:00
Frederik Gladhorn
1cc8ec1e78 Remove cruft
Change-Id: I8e0bf5b9befb0e9639da15b07072d046c038ea85
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-09 21:07:20 +00:00
Daniel Teske
ed0c0070f9 Introduce qt_subtract_from_timeout to reduce code duplication.
The same qt_timeout_value function was copied 5 times in qtbase's code,
so provide a common implementation in QIoDevice that can be used by
everyone.

This commit also corrects the remaining time calculation in
QProcess::waitForBytesWritten and QProcess::waitForFinished by using
this new function.

For QProcess::waitForFinished, if the process started within almost exactly
the timeout time passed to waitForFinished, msecs - stopWatch.elapsed() would
be -1, which is a special value.

Change-Id: I7b76ee6bae695eafdd02e3db03e2ff1e23a7f40c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-09 17:11:54 +00:00
Allan Sandfeld Jensen
1edd16879c Fix building tests on QNX
Use qmath and cmath methods instead of math.h methods.

Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-03-09 11:23:24 +00:00
Frederik Gladhorn
4dc459837b Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev 2015-03-09 11:19:22 +00:00
Frederik Gladhorn
6cef72d0b4 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I9d10911c51700965f2cf0e3173b88fd9116bd3ee
2015-03-09 10:23:15 +01:00
Mandeep Sandhu
d815de8c26 QNetworkAccessManager: Support HTTP redirection
This commit adds support for following HTTP redirect responses on a per
request basis.

This behavior is disabled by default. It can be switched on by
setting the QNetworkRequest::FollowRedirectAttribute to true.

2 new error codes have been added to QNetworkReply:

* TooManyRedirectsError: Set when the number of redirects exceed a
given value set by the user (defaults to 50 if not set)

* UnsecureRedirectError: Set when we are redirecting from a 'https'
to 'http' protocol.

Test cases for the following scenarios:
* Single HTTP redirect using local test server
* Changing max-redirects
* Testing all redirect related error scenarios

The next commit will extend this feature at a QNAM level.

Task-number: QTBUG-8232
Change-Id: If9e28ad12bad08bcdc5bc511b1cd59dc9d8150f0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-03-09 08:32:14 +00:00
Thiago Macieira
53ce0d1a31 QStringAlgorithms::simplified_helper: add missing check for detached
Otherwise, we modify shared strings that happened to be rvalues.

Task-number: QTBUG-44706
Change-Id: Ia0aac2f09e9245339951ffff13c85bfc912f03d1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-07 19:36:24 +00:00
Thiago Macieira
a8c74ddcf7 Fix race condition in QDateTime::timeZone() and other methods
When timezone support for QDateTime was added, we decided it was a good
idea to delay creating the QTimeZone object and checking that the time
is valid in that timezone (including for local time) until the user
requested that information. Unfortunately, QExplicitlySharedDataPointer
returns a non-const T* in operator->(), which meant we were accidentally
modifying the d pointer's contents in const methods, which in turn means
those const methods were not thread-safe when operating on the same
object.

This commit changes the d pointer to QSharedDataPointer, which is safer
in this regard and pointed out where the issues with constness were
located. Since we can't lazily calculate QTimeZone anymore, we need to
do it whenever the date, time or offset changes.

Task-number: QTBUG-43703
Change-Id: Ic5d393bfd36e48a193fcffff13b9686ef4ef1454
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 19:22:21 +00:00
Konstantin Ritt
da681a41cb Introduce QQuaternion::rotationTo(vecFrom, vecTo)
which returns the shortest arc quaternion to rotate vector from
to the destination vector to.

Change-Id: Ibd7a746789ecdfe6f7fe17e4ac9049f7ac46560d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2015-03-07 01:14:15 +00:00
Konstantin Ritt
1e441d298d [QQuaternion] Add a way to convert to/from orthonormal axes
It is just a convenience wrapper
around convertion to/from the rotation matrix.

Change-Id: I27511b43866827172960b0152f1c7b65da857f6f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 01:14:04 +00:00
Shawn Rutledge
8b0fcd8718 xcb: implement and deprecate QWidget::setWindowIconText()
This is a little-used feature which only affects how minimized icons
are displayed on certain older window managers, and is not necessary
even then.  It has not been implemented in Qt 5 until now.

Task-number: QTBUG-44659
Change-Id: Ie6ead7a6f922878b349a096d905bf7f675dc2f31
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-03-06 19:54:57 +00:00
David Faure
74117b5100 QCommandLineParser: add parsing mode for options after arguments
The new mode, ParseAsPositionalArguments, allows to interpret
"application argument --opt" as having two positional arguments,
"argument" and "--opt".
This mode is useful for executables that aim to launch other executables
(e.g. wrappers, debugging tools, etc.) or who support internal commands
followed by options for the command. "argument" is the name of the command,
and all options occurring after it can be collected and parsed by another
command line parser, possibly in another executable.

[ChangeLog][QtCore][QCommandLineParser] Add parsing mode for options
after arguments, to allow treating them as more arguments.

Change-Id: I48d5fcf90f2f59deda8422538b8ebf2680fae828
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-06 09:09:31 +00:00
Thiago Macieira
775d04f97e Add a QHostAddress::toIPv4Address overload taking a bool *ok
This allows one to check whether the conversion is successful without
checking for the return result, as the value of 0 represents the valid
IPv4 address 0.0.0.0.

Change-Id: I637fe55583f2255c85b0d955e5886b61494e0c7c
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-06 07:53:59 +00:00
Thiago Macieira
c64d27a9f7 QHostAddress: Revert auto-converting of IPv6 v4-mapped addresses to IPv4
In 85136496bc, Shane made QHostAddress
automatically convert any IPv6 address that was v4-mapped to IPv4 in
QHostAddress. While that is an interesting trick, it prevents us from
being specific about what we want. On some OS (like FreeBSD and OS X),
the distinction is relevant, so keep it.

Moreover, it was inconsistent: it might fail depending on how the
QHostAddress was constructed and the order of comparison.

[ChangeLog][Important Behavior Changes] QHostAddress will no longer
convert IPv6 addresses of type "v4-mapped" to IPv4. To perform this
conversion manually, construct another QHostAddress with the result of
toIPv4Address().

Change-Id: I06afbc7018539804bb3044ef1fe6a49ac7a5f240
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-06 07:53:50 +00:00
Gabriel de Dietrich
374c60e046 Make QPersistentModelIndex an internal meta-type
It was already a user meta-type, so it only gets
promoted to internal.

[ChangeLog][QtCore] QPersistentModel index becomes an built-in
meta-type, including QVariant support.

Change-Id: I63d733d1eb66aa61691e7afce27fe7372a83ac00
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-03-06 07:07:39 +00:00
Thiago Macieira
208cd9ebf1 tst_QDnsLookup: Update to match the new zone for test.qt-project.org
This commit updates the NS records and disables the lookup for
ptr-single.test.qt-project.org, as the new provider does not support
adding PTR records outside of the in-addr.arpa zone.

This commit reverts f9c70128bb, which was
a reversal of 24c52bd44b.

Change-Id: Ia0aac2f09e9245339951ffff13c7cab530a41515
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-05 21:34:52 +00:00
Friedemann Kleint
87af240c86 Manual dialog test: Add a message box for printer errors.
Task-number: QTCREATORBUG-13742
Change-Id: I137854eee589cde7a6cf3b841b0b63311e031517
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-03-05 16:01:59 +00:00
Boris Dušek
1cdb117001 Fix accessibility character rect tests
textEditTest in qaccessibility test was using QTextEdit::setCurrentFont
on second pass, but that did not change the font used for text in any way.
I don't know what was the purpose. So I changed it into something that
made sense to me and actually tests text with a different font on second pass.

Also fixed characterRect function in tests to use correct font/format.

Change-Id: I3663e02abda381be1401e298c15b51cd0fb75939
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-05 15:04:52 +00:00
Frederik Gladhorn
b1c43b072f Fix tst_qaccessibility::textEditTest for some screen resolutions
On a high resolution display the test will potentially create a text
edit that introduces line breaks and these make it fail then.

Change-Id: Ie82cc4b4139fe0f51ddca219c5c911957fa715b7
Reviewed-by: Boris Dušek <me@dusek.me>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-05 15:03:50 +00:00
Konstantin Ritt
a5d5353b59 Introduce QQuaternion::dotProduct()
Change-Id: I14b9857ca0a43808b7d536fc258a6bb10f611211
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-03-05 10:46:07 +00:00
David Faure
6c973dee2c Make QCoreApplication::applicationName available after app destruction.
Calling applicationName() in the destructor of a global static (e.g.
via QLockFile) was working when calling setApplicationName explicitly
but otherwise it would suddenly return an empty string.
This led to inconsistencies, the application name switching from
non-empty to empty at saving-on-destruction time.

There was already a global static, used when setting the app name
explicitly before construction. Use it now to store the app name
in all cases (explicitly set, or fallback).

Change-Id: I71d3a0c40158f8bfd022c385b198346a2594b1cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-05 10:29:27 +00:00
Thiago Macieira
212285639d Add missing fetchAndXxx methods to atomic classes based on std::atomic
And add tests for the GCC intrinsics and for std::atomic.

Task-number: QTBUG-43794
Change-Id: Ic5d393bfd36e48a193fcffff13b9b2dbaee80469
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-03-05 00:05:00 +00:00
Thiago Macieira
9fb68a90af Fix bind+connect in both TCP and UDP
This has been known to be broken for a while. Now it works: you can bind
and you'll retain the port (and the file descriptor) for the connect
call. Incidentally, in fixing the binding for more than one IP for the
hostname (with event loop), this commit fixes the setSocketDescriptor
XFAIL.

[ChangeLog][QtNetwork] Fixed a bug that caused both QTcpSocket and
QUdpSocket to close the socket and lose any bound ports before
connecting. Now bind()/setSocketDescriptor() followed by connect() will
retain the original file descriptor.

Task-number: QTBUG-26538
Change-Id: I691caed7e8fd16a9cf687b5995afbf3006bf453a
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-04 23:58:03 +00:00
Oswald Buddenhagen
38b5e9f8ba Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Idd21ab419588ee8b893649e3227d41c46a32e519
2015-03-04 16:49:00 +01:00
Oswald Buddenhagen
8ac63a3323 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I556be99cc7ad3fc6f7177542b7444269616a7478
2015-03-04 13:44:29 +01:00
Eirik Aavitsland
509bc7e59c Fix another crash when converting format of buffer-created QImage
This continues 68762151db

When doing format conversion, the optimized inplace codepath did not
check if the image data was external, i.e. if the QImage had been
created by the constructor taking an existing external buffer.

The previous commit fixed the readonly case. But in the case of the
QImage constructor taking non-const uchar*, data will be read-write,
but still external. This would of course crash if the converter tries
to realloc it.

Task-number: QTBUG-44610
Change-Id: I94d275d464e8af221682b538fc3e4897a59c061e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-03-04 10:53:00 +00:00
Thiago Macieira
96e9b41e25 tst_QNetworkDiskCache: Stop using actual web servers
www.example.com is a reserved domain (RFC 6761), but IANA is running a
web server there. As for www.foo.com, that also exists, is a real
website and is often content-filtered in corporations (it triggers a
firewall warning for me -- "You attempted to visit a site that is in
violation of Intel acceptable use guidelines").

So use a localhost instead, since we don't actually need to connect to
the servers to do the work. And since we don't need to connect, I chose
port 4 as it's extremely unlikely someone is running an HTTP server
there (/etc/services lists it as unassigned).

Change-Id: Ia0aac2f09e9245339951ffff13c82439c6d5f945
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-04 09:17:10 +00:00
Allan Sandfeld Jensen
59f168c5e5 Optimize fallback RGB888 to RGB32 conversion
Improves the conversion from RGB888 to RGB32 on platforms without SIMD
versions. This includes the fallback used on non-neon ARM devices.

Besides image conversion the routine is also used for decoding JPEG.

On x86 this version is within 0.7x of the speed of the SSSE3 version.

Change-Id: Id131994d7c3c4f879d89e80f9d6c435bb5535ed7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-03 13:38:17 +00:00
Shawn Rutledge
b134327475 QTabletEvent manual test: use built-in QDebug operator
There's no need to decode the event details here anymore, and anyway
this had a bug: it always said the device is unknown.

Change-Id: If99dddbe2136d95e818f4fe526f62650cbd7c1ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-03 13:30:54 +00:00
Shawn Rutledge
877032bfdf autotests: fix the build in case of QT_NO_WHEELEVENT
Wheel event tests aren't possible if there's no wheel event.

Change-Id: Ibe380c01fbf6cebfd2f43c6ecb52863134ea3c01
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-03 13:30:39 +00:00
Oswald Buddenhagen
c0a5e8c9d7 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/plugins/platforms/xcb/qxcbscreen.cpp

Change-Id: Ie42931791a849b34b63d814d2eb5ac653986d868
2015-03-03 13:37:38 +01:00
Oswald Buddenhagen
2b5982aac8 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I95b3a87c5068c6b8068b30a35655b4c2419e7f9e
2015-03-02 09:23:07 +01:00
Joni Poikelin
fc3733cba4 Fix drawing of background for multipage QTextTable cells
Task-number: QTBUG-31330
Change-Id: I0103919ee2864b7cd8bed41e6d6fe4ac5b84142e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-02 06:07:18 +00:00
Thiago Macieira
f9c70128bb Revert "Update the DNS and name-resolver tests to the official zone"
This reverts commit 24c52bd44b and makes
the Qt unit tests requiring DNS zones to use the temporary test zone in
macieira.org (Thiago's domain).

Change-Id: Ia0aac2f09e9245339951ffff13c6d3752c83b773
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-03-01 18:45:56 +00:00
Friedemann Kleint
175b12beba Prevent static functions of Q[Gui]Application from crashing if there is no instance.
Add tests.

Task-number: QTBUG-44499
Change-Id: I160b089ad3f23ab71a87519e50f8a2ef5d2a4a6f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-27 06:02:44 +00:00
Konstantin Ritt
4ed795df24 Use C++ <cmath> instead of <math.h> in math3d autotests
Change-Id: I2e13ec190ec42ac7732ce9ed3ca5567f637beb1e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-02-26 20:15:04 +00:00
Alex Richardson
3146dadb42 Allow passing absolute paths without file extension to QPluginLoader
Previously QPluginLoader("/foo/bar/plugin").fileName() would return an
empty string even if /foo/bar/plugin.so existed, now we correctly find
that file.

Change-Id: Ibf6ba329e92956de45f695be65773caacf14050a
Reviewed-by: David Faure <david.faure@kdab.com>
2015-02-26 13:31:47 +00:00
Friedemann Kleint
cd46d94906 Output registered enums in qDebug operator for QFlags.
Change-Id: Ia424df234fbd333782c10f0a4422875bb1bfc1f5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-26 12:16:51 +00:00
Konstantin Ritt
1872857ca7 [QQuaternion] Fix naming of the new methods
According to the Qt naming policy, methods that return value(s) via
the mutable parameter(s) should have "get" prefix to mention that.

[ChangeLog][QtGui][QQuaternion] Added methods to convert a quaternion
to/from Euler angles and to/from rotation matrix.

Change-Id: I95704e1f4623dc4ca54cd237ea203539fb60d452
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-26 11:02:38 +00:00
Friedemann Kleint
05e0dfa006 Reverse iteration in QMetaEnum::valueToKeys().
Otherwise, values that are composed of others are not handled
correctly. For example,
Qt::Dialog|Qt::FramelessWindowHint (Qt::Dialog=0x2|Qt::Window)
is currently output as
"Window|FramelessWindowHint" since
Qt::Window matches first and its bits are removed from the flag value
so that Qt::Dialog in the next iteration no longer matches.

Change-Id: I67db5c977c75f887392aa8f345c5e6e9d82c5c26
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-26 09:49:10 +00:00
Eirik Aavitsland
68762151db Fix crash when converting format of QImage created from buffer
When doing format conversion, the optimized inplace codepath did not
check if the image data was readonly, i.e. if the QImage had been
created by the constructor taking an existing external buffer.

Task-number: QTBUG-44610
Change-Id: I085ff8da427bc4ee392f548dffd2418b63148965
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-02-26 01:27:37 +00:00
Thiago Macieira
41ef1965c5 QSysInfo: expand Linux distribution detection to /etc/lsb-release
Some older (or weird) Linux distributions don't have /etc/os-release, so
let's try to read /etc/lsb-release instead. If we find a file called
/etc/<distronamelowercase>-release and it's bigger than the pretty name
we read from /etc/lsb-release, use that.

Because the order of the keys changes between the two *-release files,
we can't do a sorted search anymore.

Change-Id: I1a800c709d3543699131ffff13c48532d5074f3c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Dirk Hohndel <dirk@hohndel.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-25 15:49:20 +00:00
Olivier Goffart
be4f5d55fc QVariant: fix converting enum to string
Use QMetaEnum::valueToKey instead of valueToKeys.

Change-Id: I270f0820a03aaebde94c37c011c5e9b81421b50f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-02-25 15:24:40 +00:00
Friedemann Kleint
33403f2c79 Fix crash when accessing QStyleHints before QGuiApplication is constructed.
Make styleHints a static member variable of QGuiApplicationPrivate and
fix accessor accordingly. Extend tst_QApplication::settableStyleHints()
to run without QApplication instance as well and add a similar test
to  QGuiApplication.

Task-number: QTBUG-44499
Change-Id: I42b92ef38f7dd512d08d70accfa7dd4f09a22f01
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-02-25 14:16:44 +00:00
Friedemann Kleint
e4e8a8ac77 Add manual test for QMimeDatabase.
Add command line test application that can print
the mime type of a file or dump all mime types.

Task-number: QTCREATORBUG-13996
Task-number: QTCREATORBUG-14005
Change-Id: I5ef2fa4b9fbab986b1db4fc0bd8abaacdf4f8fa0
Reviewed-by: David Faure <david.faure@kdab.com>
2015-02-25 14:06:20 +00:00
Oswald Buddenhagen
9d4641f56e add autotest for qmake parser
Change-Id: Ib3dcb6c1aaac20ca6a3bc0dc564e16ec7bd152db
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-02-25 13:55:12 +00:00
Oswald Buddenhagen
756d5502f9 add autotest for ioutils
Change-Id: I63700a57e0edf5aec02abfffdc7601743379f12c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-25 13:54:36 +00:00
Oswald Buddenhagen
e507b0148b add test for the qmake library
the existing test is a blackbox test. this one is going to be different.

the first test is a bit trivial ...

Change-Id: Iba1b0b5c32490677551ee92c36f381b884c2765d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-25 13:54:33 +00:00
Alexander Volkov
76922a706f Decide whether to synthesize mouse events on a per device basis
Currently Qt uses the QPlatformIntegration::StyleHint
SynthesizeMouseFromTouchEvents to check whether to synthesize mouse
events from touch events. But not only platform plugins can produce
touch events, they can be created by e.g. QTest::touchEvent() and in
this case we almost definitely need synthesizing regardless of the
platform.

This commit introduces a QTouchDevice::MouseEmulation capability which
replaces use of the QPlatformIntegration::SynthesizeMouseFromTouchEvents.
So it's possible to pass QTouchDevice without this capability to
QTest::touchEvent() and be sure that mouse events will be synthesized.
Notice that touch pads always emulate mouse events.
As a result we can activate some tests which were disabled for specific
platform configurations by commits 6c1670d8c2
and e9760f1559.

Change-Id: Idc82fa4007a095fc1cb5934979361b0023d2b793
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-25 13:31:41 +00:00
Pasi Petäjäjärvi
059a570b8a Fix QT_POSIX_IPC support
On platforms which does not have at all sysv support, all
posix ipc tests and compilation failed because sysv
specific header files were included unconditionally.

Change-Id: I5713ace6daeb6e79f8794ce42b2b3dfa1b95ab2d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-02-25 11:42:36 +00:00
Friedemann Kleint
4725cbad26 tst_QDnsLookup: Output more information on failure.
Change-Id: Id4edf9b0672dbcabc7f749a489ae8fb6c6dde993
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-25 11:37:21 +00:00
Frederik Gladhorn
709e40093e Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Ie709286a14b452dae7abb59830f584bb33f1ccf5
2015-02-25 12:23:22 +01:00
Boris Dušek
62cd369594 Support all underline types in accessibility
Change-Id: I74684167eef13d407e94d3b9668077fe61553672
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-02-25 08:56:21 +00:00
Frederik Gladhorn
34b14a8472 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	examples/xml/htmlinfo/simpleexample.html
	examples/xml/rsslisting/rsslisting.cpp
	qmake/generators/win32/msbuild_objectmodel.cpp
	src/3rdparty/harfbuzz-ng/src/hb-private.hh
	src/corelib/global/qlogging.cpp
	src/corelib/io/qstorageinfo_unix.cpp
	src/corelib/thread/qwaitcondition_unix.cpp
	src/gui/kernel/qguiapplication.cpp
	src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
	src/testlib/doc/src/qt-webpages.qdoc
	tests/auto/other/qaccessibility/tst_qaccessibility.cpp

Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
2015-02-24 21:02:08 +01:00
David Faure
85712bae5b Autotest: fix existence check after c8c68ec.
The files were moved to a qrc resource, so the string is never empty,
we need to use QFile::exists to make sure they exist.
And the error message was wrong, pointing to current dir.

Change-Id: I532bda9f6221fb5c69b779b8b48baac9ede90eba
Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
2015-02-24 14:06:45 +00:00
Frederik Gladhorn
e9d07be949 Disable tst_qaccessibilitylinux
This test accidentally causes the screen reader (in newer Gnome
environments) to be launched. This messes up the CI machines enough that
nothing works afterwards. Disable the whole test until I write the
proper fix. We don't lose anything because it was marked as
insignificant anyway.

Task-number: QTBUG-44434
Change-Id: I410e80580977178ea99a370c6c0909d1fb49a71c
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-02-24 12:02:20 +00:00
Alex Trotsenko
dbfd3c0952 Move the socket test to an appropriate file
Actually, it tests the buffered QTcpSocket. Place it in
tst_qtcpsocket.cpp instead of tst_qabstractsocket.cpp.

Change-Id: I3055c4773d0de74c238be4f11b2d1c07ddad4485
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-23 16:33:54 +00:00
David Faure
4415fefcda QCommandLineParser: add support for hiding options from --help.
[ChangeLog][QtCore][QCommandLineParser] Added support for hiding options
from the --help output, with QCommandLineOption::setHidden(true).

Task-number: QTBUG-44298
Change-Id: I62cc2a55428365c0bcc79d2e47c72c0c92104e74
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-23 14:32:42 +00:00
Oswald Buddenhagen
d34353a065 Merge dev into 5.5
Change-Id: Id6dbbbfc542c214fe695c6795c6aaf23aedc1cd1
2015-02-23 11:24:07 +01:00
Thiago Macieira
402f994f12 Timezones: Fix handling of offset-from-UTC QTimeZones
Those QTimeZones failed to convert to other timezones because the data()
virtual function was never overridden and reimplemented. That meant all
QUtcTimeZonePrivate objects were *really* UTC, with no offset.

Task-number: QTBUG-44600
Change-Id: Ia0aac2f09e9245339951ffff13c5294bb783c674
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-23 03:55:04 +00:00
Marc Mutz
6716fe8cfd QVector: fix use of invalid iterators in removeAll()
The c2m() function which converts a const_iterator into an iterator
is a broken concept for an implicitly shared container such as
QVector, because the act of calling begin() as the starting
point already detaches and invalidates the c2m argument.

This could be fixed in c2m, but the bug wasn't even in c2m,
but in removeAll(), which called end() before c2m, so the c2m
argument was already invalidated when entering c2m.

The solution is to store the positions as indices instead of
iterators before calling the first detaching function.

Task-number: QTBUG-44592
Change-Id: I66cf4f1277e71148a4d5b5bbfb6a3369ad02db68
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-22 13:45:50 +00:00
Marc Mutz
de8a34b9bd QDateTime: drop quotes in QDebug output
As requested in review of 1d2efe1f27.
I didn't add a comma in front of the timeSpec() as the other fields
aren't separated by commas, either.

Change-Id: I54d74b7199ca7e46e28d2ceca22b02205e318c90
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-21 16:58:39 +00:00
Marc Mutz
94d79cf3d5 tst_QNoDebug: don't use sprintf if there're no arguments
This slipped in with commit 1d2efe1f27,
but is of course completely bogus (though harmless).

Change-Id: If3875b65af0fa3fe85216391599433158043e361
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-21 16:58:31 +00:00
Rafael Roquetto
7e2ef1fd21 Remove BlackBerry PlayBook support.
Reasons:
    - the PlayBook NDK is old and its compiler does not keep up with newest
      C++11 improvements inside Qt code.
    - the PlayBook NDK diverges considerably from the standard BB10 NDK,
      making it non-trivial to keep a common codebase.
    - It's a defunct platform.
    - Maintenance time is limited.

[ChangeLog][Platform Specific Changes] Removed BlackBerry PlayBook support.

Change-Id: Ia338aff55f4e4b747ebdecb0e1463a369a656c03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-02-20 14:55:54 +00:00
Eskil Abrahamsen Blomfeldt
fd18d13612 Use qrc for test data in QFileInfo test on all platforms
To make the test compatible with cross-compilation, we need
to bundle test data in qrc, and then extract files to the file
system during initialization. We did this for Android before,
but the change is required on many platforms and since it will
also work on desktop platforms, we consistently just do it this
way everywhere.

Change-Id: I7f65bd9e1dd6f217e6adffda44a40da7599cfe72
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 12:09:16 +00:00
Friedemann Kleint
916af48cff PostgreSQL: Fix special floating point handling for 'float' types.
Introduce a template function to determine the special values
via macro and use that for QVariant::Double and QMetaType::Float.

Task-number: QTBUG-44381
Change-Id: I379dd82b22d467b0aebaa42f4f0f5c52472a5c47
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-02-18 11:01:15 +00:00
Jani Heikkinen
cb95fff1c7 Fixed license headers
Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-17 18:46:09 +00:00
Oswald Buddenhagen
1cacf1e70d more autotests for spaces, destdirs and library linking
Change-Id: Ie106d1151e61a50081bccea0a6d0d70728451a5b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-17 18:27:40 +00:00
Eskil Abrahamsen Blomfeldt
57ca50cbc7 Android: Fix tst_QFileInfo::isExecutable()
Use correct path for executable file.

Change-Id: I50283fc43fe6561cb8eb687f739f21a3d5cbadbd
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-17 15:15:47 +00:00
Marc Mutz
40d6e8adf5 QList: prepare for tag dispatching based on memory layout
Add one tag class for each of QList's three different memory layouts
to QListData, and inherit QList<T>::MemoryLayout from exactly one of
them.

To simplify overloading, added tag classes that express the negation
of the two extreme poles of memory layout (C-compatible and heap),
too. The "missing" one could be added when needed, too.

Change-Id: I45ea603731499fd3fdfb37d60a0a98fb22ac15ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-17 15:05:07 +00:00
Marc Mutz
4c4940a744 tst_QList: test all memory layouts
The Movable type, surprisingly, was as large as sizeof(void*), so on
32-bit platforms, we were not testing the QList memory layout where
items are placed directly into the void*-slots, but are too small,
leaving gaps.

Fixed by making sure that Movable is smaller than void* and adding
a variant of Movable, Optimal, that is guaranteed to be the same
size as void*, and replacing the int tests with tests of Optimal.

Had to demote the State variable to uchar, since MSVC will apparently
not make a collection of bit-fields smaller than the largest type used
in any of the consituent bitfields, so State s : 8 wouldn't work.

Change-Id: I4f0e24bd6928f076b4ce60e8d977d5d98a724161
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-17 15:04:49 +00:00
Eskil Abrahamsen Blomfeldt
c3e680c3b1 Android: Fix tst_QDir::cdBelowRoot()
The /tmp directory doesn't exist on Android, and the test needs
a directory that it can cd into which is one level above root.
So we just use /system which should be available on all devices.

Change-Id: I8e6a15f278429491fd871f87af497e5d7184ddf8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-02-17 15:03:07 +00:00
Eskil Abrahamsen Blomfeldt
12d6f70037 Fix QTextDocument test when default font is pixel-sized
When the default font has the pixel size set instead of point
size, then pointSize() will return -1 and the output from the
HTML will include the pixel size instead. This happens e.g.
on Android when we extract font information from the system.

Change-Id: I26dc49fff215c9887cf0b78dcfff88df0f74450d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-02-17 15:02:48 +00:00
Albert Astals Cid
8fccfef424 Make sure there's a scene before using it
Fixes crash hovering links in quassel

Task-number: QTBUG-44509
Change-Id: I77d8d9118ad185ed70a46e91445e2960200e562b
Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-17 13:47:16 +00:00
Jan Arve Saether
395f0181ee Fix crash in QAccessibleTextWidget::attributes()
Task-number: QTBUG-44006
Change-Id: I79d7d84206a3e4abcd49c7c6e5e91b7c9c753dd6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-02-17 11:55:39 +00:00
Frederik Gladhorn
393fc2d4f5 Merge remote-tracking branch 'origin/dev' into 5.5
Needed due to license header patch.

Change-Id: Id7e30490132a7c487687a0a376419e9f9b97ea41
2015-02-17 12:35:29 +01:00
Andy Shaw
bcfacd4b6f Make sure the QSplashScreen isn't closed instantly when calling finish()
Most of the time the widget passed in to finish() will not yet have a
window handle so it would just call close() straight away. This
way it ensures has a window handle.

Task-number: QTBUG-35757
Change-Id: I2e212a2ea496cc4e4bba57a8c2d0d127afc43e48
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-02-17 08:27:20 +00:00
Olivier Goffart
50e2bc2aa0 Fix QDebug cumulating operator<< with many Q_ENUM
The problem is that the operator<< was taking a non-const reference to the QDebug
object. This causes a problem as all other operator<< return a temporary.
Since every other roperator<< takes the QDebug by value, we should also take it by value
in this case.

Move the operator<< in qdebug.h because i don't want to #include qdebug.h from qobject.h
And move the qt_QMetaEnum_debugOperator to be in the corresponding .cpp

Task-number: QTBUG-44462
Change-Id: Ia01629224c58930c2997e767efc43de90d6309e2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-02-17 06:17:59 +00:00
Laszlo Agocs
effc6b4cd1 Add widget support for requestUpdate() and improve its docs and tests
We must do something when requestUpdate() is called on a QWidgetWindow.
The semantics of UpdateRequest for QWindow and QWidget are unfortunately
different: for widgets an UpdateRequest means "sync the backing store".
For QWindow it also involves marking as dirty.

Change-Id: Idf40b3fc0873652dc081edeb12c96b3007a126ef
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-02-16 15:56:29 +00:00
Marc Mutz
1d2efe1f27 QDateTime: micro-optimize QDebug op<<
Instead of constructing a QString that describes the QDateTime
instance, stream the constituents of the string into QDebug
directly, using op<< for Q_ENUM, now that it's available.

Adapt test to new format of enums.

Effects on Linux GCC 4.9 stripped release builds:
 text  -1068B
 data    +-0B
 relocs  +-0

Change-Id: I1a5ce28904edd7d0f6c8d982fd41c52e3536e036
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-15 19:38:59 +00:00
J-P Nurmi
85ecc44eee Add missing QPlainTextEdit::createStandardContextMenu(QPoint)
[ChangeLog][QtWidgets] Added QPlainTextEdit::createStandardContextMenu(QPoint)
overload that takes the position in document coordinates. This method enables
the actions that are sensitive to the given position eg. where the user clicked.

Change-Id: I47ed7a1afc4fcfb3318c9b7af37867aeb7f2aa35
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-15 14:25:01 +00:00
Olivier Goffart
0b7ec36816 Add conversion between Q_ENUMs and strings in QVariant
Change-Id: I9264a68d162cf20db0167dd3f976a007477786d1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-02-15 08:48:01 +00:00
Jani Heikkinen
2b75c156b6 Updated BSD licensed file headers
Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-15 07:41:17 +00:00
Thiago Macieira
f5b609cac8 Make the printing of complex byte arrays prettier
Similar to what we've done to QString, only we print each byte that is
not ASCII as \OOO (octal representation).

[ChangeLog][QtTest] QtTest now prints an escaped version of
QByteArrays that failed to compare with QCOMPARE, instead of the hex
dump.

Change-Id: I6a8c43f138c66c998280998a242b43cd579666a0
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-02-15 06:35:43 +00:00
Kevron Rees
0eec8c86b6 QDBusConnection::registorObject with interface
Currently QDBus relies on a key in QMetaClassInfo to understand the DBus interface name.
This patch allows QDBus to also use a specified interface name in the registerObject call
instead of relying on QMetaClassInfo that might not be there (if the QObject was created
in QML or Javascript for example).

Change-Id: Ie02b2c67e7deb07f43e35eb166c11833fcbf38f3
Task-number: QTBUG-44074
Reviewed-by: Kevron Rees <kevron.m.rees@intel.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-15 02:17:53 +00:00
Friedemann Kleint
4dd7aeee10 Add support for GPU bug list reading.
- Add support for reading out feature lists from GPU bug lists
  in Chromium format (supporting OS + version, exceptions lists,
  device ids and vendor ids).
  Add a overloads allowing for passing file name,
  data or JSON documents.

- Test reading in tst_qopenglconfig

- Prototypically have the Windows plugin read the file
  from the environment variable "QT_OPENGL_BUGLIST" and
  turn off renderers depending on the standard keyword
  "disable_d3d11" and newly introduced keywords
  "disable_d3d9", "disable_desktopgl".

- QT_OPENGL_BUGLIST can point to an absolute or relative
  path, in which case it is resolved via QLibraryInfo::SettingsPath
  and QStandardPaths::ConfigLocation.

[ChangeLog][QtGui][Windows]
Introduce experimental feature allowing the user to specify
a GPU driver buglist with some additional keywords to chooose
the GL renderer backend depending on GPU.

Task-number: QTBUG-43263
Change-Id: I8c20b0e8ee3cf575b91d0672bf405c42d3e9fb64
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-14 16:23:47 +00:00
Tobias Koenig
eff19ed799 Haiku: Adapt tst_qstorageinfo unit test to Haiku
On Haiku the '/' filesystem is a pure namespace to mount
in the actual root partition (/boot), and therefor returns
0 for free/available/total bytes.

Change-Id: I60d4786389e01ee271f6cd1aba6f96b19e6a828f
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
2015-02-14 08:12:46 +00:00
Sergio Ahumada
2e1eb051e2 bic: Add 5.{1,2,3,4}.0 bic data for linux-gcc-amd64
Remove the ia32 data since there are no linux x86 machines in
the CI system (which makes the data useless from an automated
testing point of view) and most people use x64 these days anyway.

Change-Id: Ifdf8850767869eb2706e2a9d6396314d1fb25500
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-02-14 06:54:20 +00:00
Konstantin Ritt
88142e73d5 [QQuaternion] Introduce to/from euler angles conversion routines
Change-Id: I26c0a9d1ce9258048cf44eed5b5238920c2317b1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-14 05:45:03 +00:00
Konstantin Ritt
5d784deb71 [QQuaternion] Introduce toAxisAndAngle()
This operation is the exact opposite to QQuaternion::fromAxisAndAngle()
(so that it is a way to extract the axis and angle values suitable
to create the same quaternion via QQuaternion::fromAxisAndAngle()).

Change-Id: I41fda58f5fb2b867cccd6b2faf58ab671fa070da
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-14 05:45:00 +00:00
Kai Koehne
9ddfa43e02 MSVC: Remove use of -Zm argument
We've been setting the -Zm argument since the dawn of times (even before
the first git commit). Anyhow, MSDN from VS2008 onwards indicates
that this is not needed:

"In earlier versions of Visual C++, the compiler used several discrete
heaps, and each had a finite limit. Currently, the compiler dynamically
grows the heaps as necessary up to a total heap size limit, and requires a
fixed-size buffer only to construct precompiled headers. Consequently, the
/Zm compiler option is rarely necessary."

[ChangeLog][Compiler Specific Changes] Visual Studio: -Zm200 (an option to
specify the precompiled header memory allocation limit) is not added anymore
by qmake to the compiler calls. If you encounter an C1076 compiler error you
might need to re-add it in your .pro file.

Change-Id: Ia4bec7eba09d893a7d81886a1814602b9ce7563c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-02-13 21:23:19 +00:00
Boris Dušek
e6bbfc4d1a Make QAccessibleTextWidget::attributes respect default document font
QTextFormat::font{Weight,PointSize}() etc. return the font trait explicitly
set on the QTextFormat, while QTextFormat::font() returns font which also
uses the QTextDocument::defaultFont() as a default for any font traits not
explicitly set on the QTextFormat. Accessibility support for text attributes
used the former, which was wrong; this commit fixes it to use the latter.

Also includes tests to verify the fix.

Change-Id: Iab7f2be1b68adaad847d1f29c9e5af2195416035
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-02-13 20:53:26 +00:00
Timur Pocheptsov
63e017ee77 QSslSocket test - adapt 'verifyClientCertificate' for Secure Transport
Secure Transport relies on keychains, both client/server are constantly
updating default keychain and as a result tests are failing: when
verification is expected to fail, it succeeds; when the number of certificates
is expected to be 1 - it's 2 (Secure Transport can find certificates in a keychain).
This makes verifyClientCertificate test quite useless at the moment - QSKIP it.

Change-Id: I578398b4912a86dc60f585ac5a1bdd0098914005
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-02-13 20:43:09 +00:00
Allan Sandfeld Jensen
22b5c39e8e Optimize generic conversion and remove now obsolete direct conversions
There are many direct QImage conversions that doesn't need to be direct
but only are because they are faster than the generic conversion. This
patch optimizes the generic conversions and then removes all the direct
conversions that are now no faster than the generic.

Change-Id: I3dc5f44cc7f6358fd66420e9974eebaf2c7ca59c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-02-13 13:20:52 +00:00
Joerg Bornemann
d9f3e7a785 re-enable more QWidget tests
Re-enable tests that were skipped because of open, now closed, bugs.

Change-Id: Ic7dbe0a9cf74df1e69550536d5923a62e2186b6f
Task-number: QTBUG-26424
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-02-13 12:33:52 +00:00
Peter Hartmann
e9f30968ad QUrl effective TLDs: update table
There are more than 1000 new entries since the table has been
generated the last time.
Some auto tests needed to be adjusted, because some entries in
the TLD table were removed while others were added.

Change-Id: I4ceec392836d2031dfef49a0c5a857c31b36bb4c
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-02-13 07:28:17 +00:00
Sergio Ahumada
f11c190c06 Fix path to examples part of tst_GuiAppLauncher
Task-number: QTQAINFRA-323
Change-Id: I178cb788531c500051a7738512d8e19e1d7e7ad8
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-13 07:28:15 +00:00
Allan Sandfeld Jensen
20598f53df Improve conversion of QVariants with QJsonValues
Adds conversion from QJsonArray and QJsonObject, and report missing
conversion failures for other QJsonValues.

Change-Id: Ic0c3a952657912401db877b068f7fcc3c08c94c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-12 20:21:11 +00:00
Morten Johan Sørvig
8bccf93300 Make the QPlatformTheme::keyBindings() search deterministic
QPlatformTheme::keyBindings() performs a binary search
into an ordered list of StandardKey -> Key Sequence
mappings where each StandardKey can have multiple
key sequences.

Previously the order of the Key Sequences in the
returned list would be indeterministic and, except
for the designated pri-1 key sequence, would not
necessarily correspond to the list order. (The
ordering was dependent on where the binary search
"hits", which again depends on the size of the list.)

This caused trouble when adding mappings, since it
would change the order in the returned key sequence
list for existing mappings and confusingly cause
(apparently) unrelated test failures.

Fix this by replacing the manually coded binary search
with std::equal_range.

One test case needed to be fixed up because it had the
result in the wrong order (verified by looking at
QPlatformTheme::keyBindings).

Change-Id: I555ca2736b1a8e6454dc79645a8246f80119cfc2
Done-with: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-02-12 19:40:21 +00:00
Marc Mutz
05c38a9111 QtCore: assorted migrations to QString::asprintf
Change-Id: Ie99d3eeeced89dd8336717954fd5ca7117bb20b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-12 19:40:04 +00:00
Marc Mutz
09205f662e QtGui: assorted migrations to QString::asprintf
Change-Id: Ibb177b22064efcad56ace60935e9c8759a87a3c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-12 19:39:54 +00:00
Marc Mutz
08a8a6a842 QtWidgets: assorted migrations to QString::asprintf
Change-Id: I1a9977f52e9ce098944f876bca19669dac44d2c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-12 19:39:49 +00:00
Sergio Ahumada
e82d3b1a1e Update text to the new license header
Change-Id: I643049a865b0a8936e132e12f7845d5527f4f808
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: André Klitzing <aklitzing@gmail.com>
2015-02-12 18:29:40 +00:00
Tobias Koenig
9c5b555bac Haiku: Adapt tst_qdir unit test to Haiku
Use an existing, non-symlinked directory for the unit test.

Change-Id: Ice9976a4fd10c42c3cb014614ccd699bcea1065f
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-12 17:51:27 +00:00
Olivier Goffart
3cf8e426f4 QMetaType: Automatic registration of Q_GADGET and Q_ENUM types
Change-Id: If43dcc2b77fea5ae3ec40cc847467fc21fbd2c83
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-02-12 07:11:04 +00:00
Alex Trotsenko
071716f2da QAbstractSocket: remove unneeded cleanup calls and private member
QAbstractSocket::close() always calls QIODevice::close(), which resets
QIODevice's internal read buffer. So it makes no sense to make same calls
from disconnectFromHost(). This made the closeCalled private member
superfluous.

Change-Id: I4ec64e9711490e44e737763e4ed7fb41bffe2556
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-11 21:19:13 +00:00
A. Klitzing
2af1277631 CMake: Introduce qt5_add_binary_resources
Optional parameter DESTINATION to set target rcc file

Example:
qt5_add_binary_resources(GenerateFixture "fixture.qrc")

Task-number: QTBUG-41728
Change-Id: I9dc2fe8e7d5e9ad3873b89f75ab84a2a1b9d1d29
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2015-02-11 20:59:35 +00:00
Mitch Curtis
fe1726fd7d Document and further test that QJsonObject::keys() is sorted.
Change-Id: I6b145c1240cce85ad3fea6fb90ddbed629487f83
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-02-11 09:22:25 +00:00
Jani Heikkinen
83a5694dc2 Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Outdated header.LGPL removed (use header.LGPL21 instead)

Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)

Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination

Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
2015-02-11 06:49:51 +00:00
Laszlo Agocs
0866680bd9 Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2015-02-10 16:57:11 +00:00
Frederik Gladhorn
fc35f71434 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
	src/gui/image/qimage_conversions.cpp
	src/gui/opengl/qopenglextensions_p.h
	src/gui/text/qtextengine.cpp
	src/network/ssl/qsslsocket_openssl.cpp
	src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
	src/plugins/platforms/eglfs/qeglfsscreen.cpp
	src/plugins/platforms/eglfs/qeglfswindow.cpp
	src/plugins/platforms/windows/qwindowsfontdatabase.cpp
	src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
	src/plugins/platforms/windows/qwindowsnativeinterface.cpp
	src/plugins/platforms/windows/qwindowsscreen.cpp
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/plugins/platforms/windows/qwindowswindow.h
	src/plugins/platforms/xcb/qxcbdrag.h
	src/widgets/itemviews/qabstractitemview.cpp
	src/widgets/kernel/qwidget.cpp
	src/widgets/util/qsystemtrayicon_p.h
	tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp

Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp
conflicts.

Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
2015-02-10 09:42:25 +01:00
Jan Arve Saether
3ab6653d97 Fixed crash when adding items with spans
This only occurred if the item added was the only item in the last
row/column, since then the the internal grid failed to expand
(in this case it would always call expand(0, 0), which would not
create the extra row/column).

[ChangeLog][QtWidgets][QGridLayout] Fixed crash that sometimes happened
when adding items with spans that spanned to the bottom/right edge.

Task-number: QTBUG-38052
Change-Id: Iba95f6d9d9356b4d1c84c7b93f4af9b4ea0cf714
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-02-09 21:10:31 +00:00
Allan Sandfeld Jensen
38aafe1a17 Optimize unpremultiply on SSE4.1
Adds an SSE4.1 optimized version of qUnpremultiply and uses it in the
most drawing conversions methods. This gives a speed-up of little over
2x.

Change-Id: Ieb858a94ada1eb86d7af715ac1a100f1587f360d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-02-09 11:36:49 +00:00
Kai Koehne
868201155f QtCore: Use QDebugStateSaver in (almost) all QDebug operator<<
Unify the behavior of the different operator<< by always using
QDebugStateSaver (appending an optional space at exit), and making
sure that the space(), nospace() setting isn't 'leaked'.

Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-02-09 11:30:02 +00:00
Richard J. Moore
86b000ea1b Fix reported build failure with VS2010 on windows 8.1.
Task-number: QTBUG-44321
Change-Id: I885e3dab52193f7dfd245345fde53f6bb3420430
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
2015-02-09 10:29:08 +00:00
Jeremy Lainé
06524c11dc ssl: add test for server-side QSslSocket::PeerVerifyMode
This adds tests to check the behavior of a QSslSocket-based server when
presented with various client certificates.

Change-Id: I431157e46cfb00880ae8b7a33015cce50e56b6bb
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
2015-02-07 06:51:05 +00:00
Konstantin Ritt
ba640a75a5 [QQuaternion] Introduce to/from rotation matrix conversion routines
Change-Id: Ic19824e7e135f53a9ce3f2ea7ecd078a589e7425
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-06 16:14:38 +00:00
Maks Naumov
b444769840 Don't crash with invalid QModelIndex or when QTreeWidgetItem is NULL in mimeData()
Change-Id: I0a9abaa05cf136eadf222d3e7d102930719b84ff
Reviewed-by: David Faure <david.faure@kdab.com>
2015-02-06 09:43:38 +00:00
Sune Vuorela
14dc887090 Remove __DATE__ usage from qtbase
This message is just informal, and not really relevant to the test case.

qtbase can now be built with -Werror=date-time

Change-Id: Ic14289f2f801d5a6e811869e60afb9691c7ca98b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-05 21:18:26 +00:00
Olivier Goffart
eb4f183127 Add a qDebug operator overload to handle registered enum
So if you stream enum type into qDebug, it will show the name
of the enum value instead of the int

Change-Id: Iec5e826623353560319890d3e7c4ab97d0645f4a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-02-05 14:28:27 +00:00
Olivier Goffart
9b72bcfd60 Introduces QMetaEnum::fromType
Change-Id: I1976c1844e52ef8d70a1bbe9945f3299428dbf87
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-02-05 14:28:18 +00:00
Olivier Goffart
d43d03529f QMetatype: Register the QMetaObject of a Q_ENUM or Q_FLAG
Change-Id: Id1343c3fb51d88a43d4d97e8859dbe2b0cfbea34
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-02-05 14:27:59 +00:00
Jan Arve Saether
49af548abb Fix regression from Qt4 with layout direction
In Qt4, if the result of the translation

 QApplication::translate("QT_LAYOUT_DIRECTION")

returned "RTL", Qt usually called

 QApplication::setLayoutDirection(Qt::RightToLeft)

in order for a translation file to specify if the UI should be
left-to-right or right-to-left.

However, due to modularization, we could no longer call
QApplication::translate(), so the code was wrongly changed to call

 QCoreApplication::translate(....) instead.

This was wrong, and in addition the translation files was never updated
with the new context.

This patch fixes it to only translate it with the QGuiApplication context.
This is the only sensible context, since QApplication would lack QtQuick
support, and QCoreApplication would not know how to change layout
direction.

[ChangeLog][QtGui][i18n] Fixed bug where layout direction did not switch
according to the instruction in the translation file.

Task-number: QTBUG-43447
Change-Id: Id0409a42d41b3b9ff1cd53d090c4d9c9802f5659
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-05 14:27:22 +00:00
Peter Hartmann
3c24dddaf9 SSL NPN negotiation: Do not abort on unmatched protocols
... but choose HTTP/1.1 and continue connecting anyhow. According to
the NPN spec, actually we should choose SPDY:

"In the event that the client doesn't support any of server's protocols,
or the server doesn't advertise any, it SHOULD select the first protocol
that it supports."

However, some tested servers did not advertise anything and did not
support SPDY, so blindly trying the newest protocol would fail. We are
conservative in that case and choose HTTP.

Task-number: QTBUG-40714
Change-Id: Ia8aaf01fea74e13d9e4416306f85f1890b25559e
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-02-05 14:07:19 +00:00
Friedemann Kleint
239f67f158 Do not close popup widgets when showing a widget embedded into QGraphicsView.
Disable top-level widget code path for embedded widget in the show
helper.

Task-number: QTBUG-43780
Change-Id: I574e07130e5e68a019a426cee3fde982f3883720
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-02-05 13:54:01 +00:00
Friedemann Kleint
c56da2e8da Diaglib: Fix compilation with MSVC 2010 / SDK 7.X.
Change-Id: Idf6adc6d3788c3ac6fda770c4cf42bceb530cd48
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-05 05:21:26 +00:00
Friedemann Kleint
dff18b8e80 Windows: Allow for passing a modified argv to QCoreApplication.
Check by comparing __argc/__argv whether a modified argv was
passed to QCoreApplication. If that is the case, build
QCoreApplication::arguments() from that argv instead of using
the command line.

[ChangeLog][Important Behavior Changes][QCoreApplication]
On Windows, QCoreApplication::arguments() now returns a list built
from argv on Windows as well if a modified argv was passed to the
class' constructor.

Task-number: QTBUG-30330
Task-number: QTSOLBUG-184
Change-Id: I2498bb554130e7bfaeada3aebe786dfdd0eb534d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-05 05:20:20 +00:00
Allan Sandfeld Jensen
57469a8e10 Avoid creating a QPixmap on QBrush comparisons
We shouldn't create QPixmaps when comparing QBrushes that do not
contain a QPixmap.

This patch extends the comparison logic to comparing QImage cachekeys
if the brushes are QImage based.

Note the comparison still produces false negatives on equal content on
different pixmaps and images, but this is preserving existing behavior.

Task-number: QTBUG-43766
Change-Id: I001b4032172c1e568aad311f7df2eaae6aee8dc6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-02-04 22:10:17 +00:00
Allan Sandfeld Jensen
89edf43c44 Generate SSE4.1 versions of premultiplying methods where convenient
The autovectorized versions of premultiplying conversions are almost
twice as fast with SSE4.1 as with SSE2. Therefore this patch lets
compilers that can make those versions convenient without duplicating
code do that and lets us use them when available.

Change-Id: I699035963abe55a38b9ef8ba7b4a8c961c8dfcdd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-02-04 19:37:22 +00:00
Tor Arne Vestbø
5432f2c7a1 Remove traces of the Maemo platform
Change-Id: I6b551de331aa0386ea53d8e96f50b669777d2d69
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-02-04 17:14:35 +00:00
Oswald Buddenhagen
cf38b12a27 make shellQuoteWin() be more sparing with circumflexes
... as newer versions of nmake (and jom, for compatibility) have botched
circumflex processing (they simply don't do it when shortcutting the shell
evaluation).

as a side effect, the output is also more readable if the string contains
quotes.

Change-Id: I0506b59ceecb70da258c482f9973156b2803066d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-04 16:34:02 +00:00
Oswald Buddenhagen
ca15d0d7e1 de-noise test
don't complain about various missing things resulting from replacing
default_pre.prf and having a private .qmake.cache.

Change-Id: Ie3471b514ebb1a80b72a480144551b56b5c7a254
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-04 16:33:51 +00:00
Oswald Buddenhagen
ed3aca119f make test support qmake path with spaces
Change-Id: I66d8b3cc742c44d02c224bbfc4086500af0d5f4a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-04 16:33:33 +00:00
Oswald Buddenhagen
68c750dd4b don't rely on the right moc being in PATH
Change-Id: Ibe89f9d3090398e0c5fc63d32dec18934bf89ac4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-04 16:32:42 +00:00
Oswald Buddenhagen
b91558419b don't rely on the right qdbuscpp2xml/qdbusxml2cpp being in PATH
Change-Id: I50f639632dcb37c9752b41241a21c9fcd9dde0dd
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-04 16:32:40 +00:00
Richard J. Moore
91a48160d6 Move Rfc822NameType, DnsNameType and UniformResourceIdentifierType.
Move these types to QAsn1Element so that they can use the toString()
method which guards against malicious ASN.1.

Change-Id: I7d6155147a6fc2d41da6f3ae87551b6cb75aa9ce
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
2015-02-04 15:49:50 +00:00
Richard J. Moore
3bc5f8c081 Harden QAsn1Element against malicious ASN.1 strings.
We don't currently use this class for critical things like hostname
verification however we still want to ensure that it is not possible
to trick it using ASN.1 strings with embedded NUL characters. This will
avoid problems in the future.

Change-Id: Ibf3bc142a94fc9cad5f06db50f375399a087f9dc
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
2015-02-04 15:49:35 +00:00
Gabriel de Dietrich
7ab29c4ebb Allow exposing QItemSelectionModel to QML
This requires being able to create a QItemSelectionModel
without specifiying its model, and also setting the model
later. Also, several classes, like QPersistentModelIndex,
need to be declared as meta-type.

Finally, and in order to introduce the 'model' property,
we need to have a type compatible getter. Hence the new,
non-const model() function.

Where needed, meta-type declarations have been removed from
auto-tests.

[ChangeLog][QtCore][Item Models] QItemSelectionModel
can now be created without a model and have one set later.

Change-Id: If49bed061a5d1012331f335ca7f6e3959ecd3f1c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-02-03 18:40:19 +00:00
Allan Sandfeld Jensen
5bd41b850f Correct inplace conversion methods from RGBA8888 formats
The methods for inplace conversion from RGBA to ARGB was misplaced by
one step causing conversion to RGB16 to get an invalid method.

Change-Id: I3b2b4cffe993705c48613eec7d9b7c6213f57fc2
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-02-03 14:21:29 +00:00
Tor Arne Vestbø
c5db8fc74a Make it more obvious that Q_WS_ is dead code, and should perhaps be ported
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.

In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.

Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-03 11:49:14 +00:00
Arnaud Bienner
cd7a36d341 QHeaderView: check that length is correct and fix restoring Qt4 state.
When multiple sections were grouped together, sectionItem.size was the total size of grouped sections, not the size of one section.
Length is supposed to be equal to the section items length, but the state saved might be corrupted.

Task-number: QTBUG-40462
Change-Id: I401a1583dd30880ccf5b4c105a237d6563f212e8
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2015-02-03 08:45:33 +00:00
Friedemann Kleint
b85b78f17d Suppress Ctrl/Ctrl+Shift keypresses in line/text edits.
Ctrl/Ctrl+Shift should not cause any characters to be input
(as opposed to AltGr(Alt+Ctrl) as used on German keyboards).

Extend the tests in QLineEdit and QPlainTextEdit to
check the modifiers, remove test from QTextEdit
since it is handled by QWidgetTextControl.

Task-number: QTBUG-35734
Change-Id: Ie0004fac68cf840c68247f27547e84b021355cd2
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2015-02-03 06:24:11 +00:00
Ruslan Nigmatullin
a40d390a3b Fixed icons lookup in QIcon::fromTheme
This commit fixes incorrect logic of icons' lookup if there are
fallbacks or more than one theme's directory.

According to Icon Theme Specification, Directory Layout section, theme
can be spread across several base directories by having subdirectories
of the same name. This makes possible to extend system themes by
application-specific icons without making of collisions with other
applications.

According to Icon Naming Specification, Icon Naming Guidelines section,
icon name may contain dashes to separate levels of specificity in icon
names. This makes possible to set in application very specific icon
which may be not in every theme. So it can fallback to less specific one.

Change-Id: Iafc813902a3646be56e8f1d3a2fdbf8fd32ac542
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-02 23:28:19 +00:00
Friedemann Kleint
ec71482374 Add qopenglconfig test.
Add some parts of the qtdiag tool as a qtbase test to output the
graphics configuration to the CI log and to verify that Open GL can be
initialized for platforms on which the qopengl test is marked as
insignificant (for example, ANGLE).

Change-Id: Id445e57928e0307ad38cd433c52a62501f1097c6
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-02 23:05:41 +00:00
Allan Sandfeld Jensen
9cd5c61455 Avoid unneeded QBrush::texture() calls
If a QBrush has been created without QPixmap the texture() method will
create one. This patch avoids that in several places by checking the
type of the texture brush before accessing it, or not accessing it at
all.

Task-number: QTBUG-43766
Change-Id: If6009fe1d5bd51b239ae2c838e5c3b904b56b11a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-02-02 22:05:31 +00:00
Dyami Caliri
2a27fc41a4 Fix QGraphicsWidget window frame section logic
CppCat detected duplicate sub-expressions in the code that checked for
BottomLeftSection and BottomRightSection. It was fairly obvious to
see what the values should be.

Change-Id: Id45ca5bbd26c92b800c60867fef5170578216eee
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2015-02-02 21:38:23 +00:00
Jeremy Lainé
5382312e5c Add SecureTransport based SSL backend for iOS and OS X
Add support for SSL on iOS/OS X by adding a SecureTransport based
backend.

[ChangeLog][QtNetwork][QSslSocket] A new SSL backend for iOS and OS X,
implemented with Apple's Secure Transport (Security Framework).

Change-Id: I7466db471be2a8a2170f9af9d6ad4c7b6425738b
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-02-02 14:02:56 +00:00
Allan Sandfeld Jensen
9be87085d8 Only use 32bit version of qPremultiply
With auto-vectorization enabled in QtGui, the 32bit version of
qPremultiply is faster than the 64bit version since it can be vectorized
wider (4x on 128bit as opposed to 2x). Since all our important 64bit
targets have SIMD, that makes the 64bit version pointless.

Change-Id: I4e9070a3a3c8e2b54f17a95ba0aee0405cbb8ec9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-02 11:14:00 +00:00
Frederik Gladhorn
55162dae7e Merge remote-tracking branch 'origin/5.4.1' into 5.4
Change-Id: Idadb5639da6e55e7ac8cc30eedf76d147d8d5d23
2015-01-29 10:05:01 +01:00
Lars Knoll
bcf6a3eb34 Remove unused class QPaintBuffer
The class hasn't been used for a while anymore. Since it's
private, simply remove it from QtGui.

Change-Id: Ia0911d1c8b8836d963a51c8e354c96bc1ee4093f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-01-28 15:44:18 +00:00
Shawn Rutledge
fe8900405d Use qt.io rather than qt-project.org for network tests
Mainly because of a change in certificates which is causing failing
tests.

Change-Id: I8304e5ac4107428a250b71be5df7b5399a811017
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-01-28 12:50:32 +00:00
Erik Verbruggen
467c2bc9c3 Remove support for QT_QLOCALE_USES_FCVT.
We expect floating-point math to be IEEE754 compliant.

Change-Id: I2b257177f2ef5fce38ac4d8fd76f746dc7b9fc15
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-01-28 12:44:55 +00:00
Konstantin Ritt
14419b0a2b Introduce QQuaternion::inverted()
Change-Id: I6de77082bb7c32e48fb7f7d765a58fdbe68db1fd
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-01-28 12:37:50 +00:00
Konstantin Ritt
a14559bc78 [QVectorND] Add missing operator/=(const QVectorND &)
Change-Id: Ic1d2912808b95e02ba5d9cb2972c81c6374bbca9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-01-28 12:37:47 +00:00
Eskil Abrahamsen Blomfeldt
ce9c4915d5 Android: Don't open assets files in read/write mode
We would return true when opening assets in read/write mode despite
the fact that the files are not writable. The logic now matches
that of the qrc file engine.

This also adds a unit test for Android-specific issues.

[ChangeLog][Android][Important Behavior Changes] Opening assets with
QIODevice::ReadWrite now returns false to correctly indicate that the
files are not writable.

Change-Id: I019cc27861fc9b000dc13c5e0a38c0fc09a08671
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-28 12:20:54 +00:00
Shawn Rutledge
6430d6e3ec Use qt.io rather than qt-project.org for network tests
Mainly because of a change in certificates which is causing failing
tests.  This patch is cherry-picked from
https://codereview.qt-project.org/104619/

Change-Id: I8304e5ac4107428a250b71be5df7b5399a811017
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-28 11:10:19 +00:00
David Faure
dd23d9f161 QTreeWidget: forbid forcing PartiallyChecked on parent tristate items.
ItemIsTristate means QTreeWidget determines the check state of parent
items based on the check state of child items.
Checking/unchecking the parent propagates to children; but setting
the parent to PartiallyChecked shouldn't do that, especially since it can
lead to children without ItemIsTristate having PartiallyChecked check state.

Change-Id: Ibc8b7c77d9ec4c1578c07f3c62581edb770f8439
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-01-25 12:37:51 +01:00
David Faure
4910f416c2 Itemviews: add ItemIsUserTristate flag
ItemIsTristate is now again purely for enabling the automatic management
of the check state of QTreeWidgetItems, while ItemIsUserTristate is
separate from that and lets the user select the three states manually.

This restores the original behavior of ItemIsTristate for QTreeWidgetItems,
which got broken by letting the user cycle through the states too.

[ChangeLog][QtWidgets][QTreeWidget] Restored Qt 5.1 behavior of
QTreeWidgetItems with ItemIsTristate to enable automatic management
of the check state. User-editable tristate checkboxes are now enabled
by setting the new flag ItemIsUserTristate.

Task-number: QTBUG-40060
Change-Id: I341f5e983804d3b4f27982520bb6647f3014cccc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-01-25 12:37:41 +01:00
Thiago Macieira
817800ad39 Fix QXmlStreamReader parsing of files containing NULs
Due to a flaw in the internal API, QXmlStreamReader's internal buffering
would mistake a NUL byte in the input stream for EOF during parsing, but
wouldn't set atEnd == true because it hadn't yet processed all bytes.
This resulted in an infinite loop in QXmlStreamReaderPrivate::parse.

So, instead of returning zero (false) to indicate EOF, return -1 (but in
unsigned form, ~0, to avoid ICC warnings of change of sign). In turn,
this required enlarging a few variables to avoid ~0U becoming 0xffff,
which is a valid QChar (could happen if the input is a QString, not a
QIODevice).

Task-number: QTBUG-43513
Change-Id: If5badcfd3e4176b79517da1fd108e0abb93a3fd1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-01-24 18:35:22 +01:00
Allan Sandfeld Jensen
dd07b1e389 Add conversion functions for C++11 u16string and u32string
The patch adds convenience functions for working on C++11's new char
width specific unicode strings u16string and u32string.

[ChangeLog][QtCore][QString] Added methods for convenient conversion
to and from std::u16string and std::u32string.

Change-Id: I67c082e4755c592d61daaaaa70c8867ef0b23dcb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-01-24 11:50:13 +01:00
Marc Mutz
f272c40697 tst_QSet: make qhash() test deterministic
Change-Id: I857e66f21030da2210122c8c95c95f05a73da50a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-01-23 23:38:27 +01:00
Rafael Roquetto
8ca735762d Fix tst_process on QNX when using spawn
QNX posix_spawn() implementation actually allows for detecting whether a
non-existent process has failed to start.

Change-Id: Ic1bf8da0d4636f1d7d9b7b4cf6ad45376f6df0ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-23 19:13:38 +01:00
Thiago Macieira
75a2c81b00 Handle posix_spawn using exit code 127 to indicate fail-to-start
Most posix_spawn implementations are done using fork(), so the only way
to report errors afer fork() is via a special exit code.

Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
Change-Id: I3a37f81b0cb278bb31e5cb83c87e6b4c034dbc19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-23 19:13:27 +01:00
Thiago Macieira
1814142b7a Use forkfd in QProcess
Replace the existing code in QProcess that dealt with signaling of child
processes exiting with forkfd and spawnfd. The previous code was
convoluted and hard to maintain, having shown its age in the last
year. I've been running it for a year and a half and the new
implementation is definitely an improvement.

This change replaces support for the QNX Neutrino spawn() call with the
POSIX version. We lose the ability to do setsid(), but we gain quite a
few ioctls() that were done to fill in the file descriptor mapping
structure. That's also the only OS for which we have the ability to
thread-safely chdir() before the call to spawnfd().

Another advantage is that forkfd does not require a dedicated thread
running to handle child processes exiting.

Change-Id: I5eb76821dfdb6a8ed2989d7f53b3c31e515c3174
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-01-23 19:13:17 +01:00
Thiago Macieira
c8849dd8d5 Use waitid with WNOWAIT in forkfd
The previous implementation required one syscall per child we're waiting
on to see which one exited. That means the algorithm was O(n).

This implementation uses WNOWAIT to find out which child exited and then
goes straight to that one. So it's O(1) on the number of children, but
runs 2 * number_of_children_that_exited + 1 syscalls, assuming there are
no race conditions with other threads. If there are or if a child not
started by forkfd exits, we'll still iterate over each child we're
managing to see which one exited.

It modifies the existing code so that it will do a waitid() with WNOWAIT
to check on the status of the child: if the child has exited, we'll try
to lock the entry so only one thread will do the final wait(). In the
case we read the PID, then the child exited, was reaped by another
thread, the PID got recycled and that child exited again, we'll fail to
lock the ProcessInfo entry so no harm comes. If by an absurd coincidence
this other child was started by forkfd() and its ProcessInfo is exactly
the one we are looking at, then we'll succeed in locking but that's a
benign race: we'll do what the other thread was trying to do and the
other thread will give up.

Future improvements to the algorithm are discussed in the Gerrit change.

Change-Id: Ie74836dbc388cd9b3fa375a41a8d944602a32df1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-23 19:12:53 +01:00
Alexander Volkov
de71c8a6f8 Add QTextStream::readLine() overload
The most common use case for QTextStream::readLine() is reading
a file line by line in a loop. The existing readLine() method
allocates new memory for each line, that results in a loss of
speed. The introduced overload can use already allocated memory.

Besides it allows you to not think about filesystem specifics.
The current QFile documentation suggests a separate way to read
files from /proc filesystem. With this overload it's possible
to use the same idiom in all cases:

    QTextStream in(&file);
    QString line;
    while (in.readLine(&line)) {
        process_line(line);
    }

The idea was inspired by the blog post of Ivan Čukić:
http://ivan.fomentgroup.org/blog/2014/10/03/api-design-and-impact-on-the-performance-qt-vs-stl-example/

Change-Id: I0c62b4a52681870589bc099905e83ed69e03dd40
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-01-23 14:36:27 +01:00
Konstantin Ritt
4046055caf Deprecate QFont:: rawMode()/setRawMode()
rawMode only has an effect under X11 in pre-QPA times.

Change-Id: Iaff8fed8f4ae5af5dd0399bb3ebd9d590a39a758
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-01-23 14:06:03 +01:00
Andy Shaw
906577c8b0 Enter/Return should cause an edit inside an itemview on OS X
This was available before but was protected with the wrong define for OS
X, so this is changed to the right define.

Task-number: QTBUG-23696
             QTBUG-23703
Change-Id: I669a6cf2ff7c01020693adff9f04a4b8b9404d02
Reviewed-by: David Faure <david.faure@kdab.com>
2015-01-23 10:35:14 +01:00
Friedemann Kleint
cebd6d59cb Diaglib: Fix compilation with Qt 5.3.
QDebug does not have noquote() in Qt 5.3.

Task-number: QTBUG-44021
Change-Id: If35b926d6b1e5bb9ad3534357630533dfcecd076
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-01-23 09:45:59 +01:00
Eskil Abrahamsen Blomfeldt
560c8ac098 Android: Fix some tests for QCompleter
When checking for completion on the file system, we need to check
for directories that actually exists.

Change-Id: Id83e3802abcd40355dcd8cd47f2d55061eacd117
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-01-23 09:43:04 +01:00
Giuseppe D'Angelo
bd26defd9b QSslSocket: introduce support for TLS PSK (client side)
[ChangeLog][QtNetwork][QSslSocket] It is now possible to use TLS PSK
ciphersuites in client sockets.

Task-number: QTBUG-39077
Change-Id: I5523a2be33d46230c6f4106c322fab8a5afa37b4
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-23 00:35:21 +01:00
Paul Lemire
595ed595ea Add project/unproject methods in QVector3D
Equivalent of gluProject and gluUnproject.

[ChangeLog][QtCore][QVector3D] add convenience project and unproject methods
to use like gluProject and gluUnproject

Change-Id: I6e4e3e79ea6e34d1fb0c375e15185c950b699ef0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-01-22 12:39:20 +01:00
Eskil Abrahamsen Blomfeldt
508b1fa173 QTemporaryDir: Remove directories on failure
When creating a temporary directory but failing to set its permissions,
we need to remove the directory we created to avoid leaving 256 empty,
unused directories in the destination folder.

This happens on Android if you try creating a QTemporaryDir in the
download path on the sdcard.

Task-number: QTBUG-43352
Change-Id: Ic88fb7572f1abd65e5c7d8882b59c95f4b22ed72
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-22 08:31:54 +01:00
Giuseppe D'Angelo
2ecde56f65 QSortFilterProxyModel: fix a regression
bec1854cc0 introduced a regression:
when sorting a tree model, children items would not follow the sorted
parents any more (they wouldn't be remapped correctly), resulting
in crashes.

So, the fix needs more reasoning; let's revert the fix,
but leave  the original test around for any subsequent attempt, and
introduce a new test which looks for the right behavior when
sorting trees.

This commit partially reverts bec1854cc0.

Task-number: QTBUG-43827
Change-Id: Ic83ac53aef639f870f6c36a8b4b2992f5b485b13
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
(cherry-picked from qtbase/e9ad46ed412987e3e46c5a641e5f30408b97ac90)
2015-01-22 08:31:28 +01:00
Rainer Keller
c8c68ecb8f Autotest: Make mimedatabase testdata resources
Change-Id: Ia410d6b0cdece248651213dbbb035c951e5f6983
Reviewed-by: David Faure <david.faure@kdab.com>
2015-01-22 08:10:05 +01:00
Thiago Macieira
a4c837b3a1 Fix QUdpSocket's emission of readyRead()
The documentation says that QUdpSocket emits readyRead() only for one
datagram and that if you don't read it, the class will not emit again.
That should be implemented by disabling of the socket notifier once we
have the datagram already read, but was broken.

In turn, that breakage caused a live-lock of the event loop: since we
didn't disable the notifier nor read the pending datagram, the event
loop would fire every time for the same datagram.

The re-enabling of the notifier was already working.

Task-number: QTBUG-43857
Change-Id: Ic5d393bfd36e48a193fcffff13bb32ad390b5fe8
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-22 04:44:10 +01:00
J-P Nurmi
cec7dcc723 QTextDocumentLayout: handle QTextBlock visibility
Task-number: QTBUG-10153
Change-Id: I0420b9c59a7a437da28675349c14e84bfa4aea54
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-01-22 00:22:53 +01:00
Frederik Gladhorn
358a9ac936 Do not include accessibility.pri twice
Change-Id: Id4b312a57b098ad893ba08e7a3c7f1a0fb891eef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-21 20:38:22 +01:00
Frederik Gladhorn
0eaa86dd01 Accessibility: Fix selection change notifications on Linux
The selection update is not implemented on other platforms (if needed at
all).

Task-number: QTBUG-39440
Change-Id: I8eb8c4eb1c23ba2d246bc95f1c77dc9da9e22495
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-01-21 20:38:04 +01:00
Marc Mutz
914c5eb36a QAssociativeIterable: add find()
This is like value(), but returns an iterator instead of the value().

[ChangeLog][QtCore][QAssociativeIterable] Added find().

Change-Id: I029fc8f91cef78f718d419587a2a50ffd2bf7632
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-01-21 11:23:43 +01:00
Simon Hausmann
112342b326 Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2015-01-21 11:14:34 +01:00
Frederik Gladhorn
b6191b16d4 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/global/global.pri
	src/corelib/global/qcompilerdetection.h
	src/corelib/global/qglobal.h
	src/corelib/tools/qdatetime.cpp
	src/plugins/platforms/xcb/qxcbscreen.h
	src/plugins/platforms/xcb/qxcbwindow.h
	src/widgets/dialogs/qcolordialog.cpp
	src/widgets/dialogs/qcolordialog_p.h
	tools/configure/configureapp.cpp

Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
2015-01-21 11:10:14 +01:00
Allan Sandfeld Jensen
05feaeed43 Remove duplicated NAN/INF logic from tst_qstring
Qt already has solutions for cross platform isnan and isinf logic. We
should use that instead of duplicating it.

This should also fix compiling tst_qstring on MinGW with C++11.

Change-Id: I7b691fd47701a8f07e1a1fe08a95a0aca43ccca1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-01-21 10:54:22 +01:00
Giuseppe D'Angelo
2ec2dbed67 QSslEllipticCurve: add fromLongName
Since the conversion to a long name was already there, also support
creation from a long name.

Change-Id: Iad712db7447fb0a0a18f600b7db54da5b5b87154
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-21 10:41:39 +01:00
Thiago Macieira
473ad206c4 Fix QSharedPointer::create and QEnableSharedFromThis
We forgot to initialize the tracker if create() was used.

Task-number: QTBUG-43696
Change-Id: Ic5d393bfd36e48a193fcffff13b740931ff2204b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-21 08:23:59 +01:00
Friedemann Kleint
0b62cd8da7 Windows: Fix coordinate offset when positioning the taskbar on the left.
For windows that do not have WS_EX_TOOLWINDOW set, the WINDOWPLACEMENT
API uses workspace/available aera coordinates. Introduce a helper
function to return the offset and use that.

Task-number: QTBUG-43872
Change-Id: I329c640f180524699b45b855b4583f447c4a0987
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-01-20 19:59:23 +01:00
Friedemann Kleint
8c5b3c6d91 Fix QVERIFY() in tst_qwidget.
Replace by QCOMPARE where applicable; introduce message to generate
output for failed comparisons with QVERIFY2().

Task-number: QTBUG-43872
Change-Id: I09c8f9fd31ceed224e441f253049f68907ca0d7a
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-01-20 19:59:18 +01:00
Simon Hausmann
fc8adfea9f Introduce helper for QML to allow creating QWidget hierarchies
Commit 1259c5768e410361bcd8b5cf0c2057a2ebabda83 in qtdeclarative removed the
ability to create QWidgets in QML by giving them the correct parent, which
requires calling QWidget::setParent instead of QObject::setParent. This patch
introduces a hook that will allow QtQml to give widgets a proper parent.

Change-Id: I84c57ca5032582c43e405219343d55ac9cf2ffa0
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-20 16:15:45 +01:00
Alex Trotsenko
a373ffcda9 QIODevice: remove ineffective caching members
Most of the QIODevice functions already have a locally cached
"sequential" flag. Make the rest of them follow this strategy.
This eliminates the need to use private caching members.

Change-Id: I0edb2c9b7c5f411c5bee25c425e7b40e3c9021d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-20 10:37:59 +01:00
Arnaud Bienner
bdcb3f9aab QHeaderView: fix restoring Qt4 state.
When multiple sections were grouped together, sectionItem.size was the total size of grouped sections, not the size of one section.

Task-number: QTBUG-40462
Change-Id: I401a1583dd30880ccf5b4c105a237d6563f212e8
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2015-01-20 10:30:54 +01:00
Morten Johan Sørvig
ee1afbb8aa tst_qstring_mac: Correct memory management.
The NSStrings return by QString::toNSString are autoreleased;
manually releasing them is not correct. The test still
works (no leaks or double deletes) since there is no
autorelease pool in place when running it.

We don't want to encourage incorrect usage: remove
the release call an add an autorelease pool.

Change-Id: Ic566fd3a8efd6cbc0eb6db850248a68bfc8fed0b
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2015-01-20 05:47:16 +01:00
Rainer Keller
668a3a4da1 Autotest: Use QFINDTESTDATA to find test data
Change-Id: Ie6c659f6d8e8b3eeaf2453f0cba6189d56f86581
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-19 15:53:51 +01:00
BogDan Vatra
a15569b269 Android: don't report xfail
Change-Id: I2998632cffc29161eb26421b07cf51a4138fcad3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-19 15:48:50 +01:00
Joni Poikelin
1909ab4b8f Add test for QColorDialog initial color
Task-number: QTBUG-43548
Change-Id: I9410072e5bf837933148d48c4f9d6797337485f5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-19 15:41:10 +01:00
Sérgio Martins
9087df6bd2 windowflags test: Fix showing which flags are set
The text edit that shows which flags we have set should be updated in
PreviewWindow::setWindowFlags() and PreviewWidget::setWindowFlags()
but QWidget::setWindowFlags() isn't virtual so only the base class
one was called.

Change-Id: I5c9d47d003d5701dde1ab63df0d349f641d66f44
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-19 11:17:49 +01:00
Pierre Rossi
890ae41d06 Fix a crash in QPlainTextEdit::documentChanged
The layout for an invalid block is very likely to be null, it
shouldn't be accessed without checking the block's validity first.
We can make the check a bit more conservative and simply check that
the block isn't empty.

Change-Id: Ic1459a6168b1b8ce36e9c6d019dc28653676efbe
Task-number: QTBUG-43562
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-19 10:47:28 +01:00
David Faure
7fc8c560e2 Fix QPrinter::setPaperSize regression when using QPrinter::DevicePixel
The QPageSize-based refactoring led to casting DevicePixel to a QPageSize::Unit
value of 6 (out of bounds). And then the switch in qt_nameForCustomSize
would leave the string empty, leading to "QString::arg: Argument missing: , 672"
warnings.

Change-Id: I85e97174cc8ead9beccaaa3ded6edfad80f8e360
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-01-19 10:39:55 +01:00
Rainer Keller
20480070a6 Autotest: Selftests fail in UTC timezone
Selftests for testlib fail when executed in UTC timezone because local and
UTC are the same, but expected to be different. A custom timezone is used
instead.
Debug output of qCompare does only handle local and non-local timezones, using
new Qt5 features allows to show the correct timezone in format string.

Change-Id: I753884a12370952b7b62a90d62896db4f2d3d1b4
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2015-01-19 10:21:26 +01:00
Marc Mutz
b8e46fce5c Add qHash() overload for QSet
...using qHashRangeCommutative(). Also add a test.

[ChangeLog][QtCore][QSet] Can now be used as the key in QSet, QHash.

Change-Id: Ie7c81d257a3b324fc03d394fa7c9fcf0c6fb062a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-18 19:36:06 +01:00
André Klitzing
962ea5690c Add elliptic curve support to QSsl
Add possibility to get length and other information of EC based
certificates. Also it is possible to parse those public/private
keys from PEM and DER encoded files.

Based on patch by Remco Bloemen

[ChangeLog][QtNetwork][SSL/TLS support] It is now possible to
parse elliptic curve certificates.

Change-Id: I4b11f726296aecda89c3cbd195d7c817ae6fc47b
Task-number: QTBUG-18972
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-18 10:18:43 +01:00
Friedemann Kleint
205f68f8ad Fix assorted MSVC warnings in tests.
tst_collections.cpp
tst_collections.cpp(3138) : warning C4305: 'argument' : truncation from 'size_t' to 'bool'
        tst_collections.cpp(3190) : see reference to function template instantiation 'void testContainerTypedefs<QVector<int>>(Container)' being compiled
        with[Container=QVector<int>]
(repeated)
tst_qringbuffer.cpp(297) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
tst_qringbuffer.cpp(300) : warning C4309: '=' : truncation of constant value
tst_qringbuffer.cpp(306) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
tst_qrawfont.cpp(947) : warning C4309: 'argument' : truncation of constant value
tst_qsslsocket_onDemandCertificates_member.cpp(217) : warning C4189: 'rootCertLoadingAllowed' : local variable is initialized but not referenced

Change-Id: I6143d4ad121088a0d5bdd6dd2637eb3641a26096
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-01-17 12:06:59 +01:00
David Faure
70ed7c727a tst_qitemdelegate: remove more duplication.
Makes it easier to add new tests.

Change-Id: I5c2bca60e125259eac83a03860e60ca85b51db24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-17 10:25:31 +01:00
Marc Mutz
2173491f06 tst_QSizePolicy::getSetCheck: separate data generation from test
This is in preparation of adding more tests.

It makes the test run longer, because of the additional book-keeping,
but if something goes wrong, it can pinpoint the circumstances better.

Change-Id: I4be68fcfbffe48e8609b722ea551b1f7c36790a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-17 10:21:06 +01:00
Boris Dušek
8a1e6f48f5 Fix qaccessibilitymac test (title vs. description)
We tested button's AXDescription, which is however used only for
non-textual buttons (e.g. buttons with an icon and without a visible
text). On the other hand, button's visible text (which is our case) is
exposed in AXTitle (and not in AXDescription).

Change-Id: Ie89c758cf94b72ade3a440561c5f3df61a4c4612
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-01-17 09:58:14 +01:00
Giuseppe D'Angelo
e9ad46ed41 QSortFilterProxyModel: fix a regression
bec1854cc0 introduced a regression:
when sorting a tree model, children items would not follow the sorted
parents any more (they wouldn't be remapped correctly), resulting
in crashes.

So, the fix needs more reasoning; let's revert the fix,
but leave  the original test around for any subsequent attempt, and
introduce a new test which looks for the right behavior when
sorting trees.

This commit partially reverts bec1854cc0.

Task-number: QTBUG-43827
Change-Id: Ic83ac53aef639f870f6c36a8b4b2992f5b485b13
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
2015-01-17 06:32:37 +01:00
David Faure
3c6f333634 QProgressDialog: don't require setValue(0) to be called.
1) everyone forgets to do so (proof: tst_qnetworkaccessmanager_and_qprogressdialog.cpp
forgot too, which led to a valgrind warning, the elapsed timer was never started)

2) setValue(0) makes no sense if the progress dialog goes from 50 to 60,
or any other non-zero minimum value.

Fixed by starting the timer in the constructor (most code doesn't reuse
progress dialogs, so this fixes the most common case), and by also starting
the timer when calling setValue(minimum()) for well-behaved dialogs.
setValue(0) special case kept for compatibility.

Task-number: QTBUG-17427
Task-number: QTBUG-25316

[ChangeLog][Important Behavior Changes][QProgressDialog] The timer for estimating
the duration of the progress dialog is now started in the constructor and in
setValue(minimum()), as well as when calling setValue(0), as previously documented.

Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: Ia8f7fc677438749191b99074fc334eab652ea36f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-17 06:32:21 +01:00
Oswald Buddenhagen
3f17d0349b Merge 5.4 into 5.4.1
Change-Id: I78d848c0bb396584a205a8066d253f2bcac8da56
2015-01-16 21:02:26 +01:00
Friedemann Kleint
9d1bcd727a Diaglib/Event filter: Output application state on focus events.
Output the current active/modal/popup windows when receiving
FocusAboutToChange or FocusIn events.

Task-number: QTBUG-42731
Change-Id: Ia88e9a9b41f7c80fb7a2a048b06da56d989ff18a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-01-16 17:25:20 +01:00
Eric Lemanissier
c28718b88b Correction on bound values in case of repeated QSqlQuery::execBatch
Until now, QSqlQuery::execBatch did not call resetBindCount, which lead
the next call to QSqlQuery::addBindValue to start at non zero index.
This is problematic in case of a prepared query which is called several
times.

Task-number: QTBUG-43874
Change-Id: I1a0f46e39b74d9538009967fd98a269e05aac6f2
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-01-16 13:14:26 +01:00
Laszlo Agocs
19b8edebf5 Make transparency test actually test transparency
The OpenGL windows should have some more obvious
transparent areas in them.

Change-Id: I7d000cd367208f99a79b11c341bf94062613f357
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-16 12:12:37 +01:00
Eskil Abrahamsen Blomfeldt
4448576ae0 Android: Fix QLayout tests
This test requires test data to be available and the
testRetainSizeWhenHidden test assumes that a widget will be
sized based on its sizeHint(), which does not work on
platforms where show() implies showMaximized().

Change-Id: I9bf372d8c0ea94845ae08481ec555fe25dcfebc0
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-16 09:27:57 +01:00
Eskil Abrahamsen Blomfeldt
7a760f5ed9 Android: Fix QDirModel tests
This test needs to have a test environment available on the regular
file system, so we create this when initializing the test. In
addition we QEXPECT_FAIL one of the tests which seems to expose
a legitimate bug. A bug report has been created for this.

Change-Id: I7c90aea78a067815cb647a51db5d91a652a9fc1c
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-16 09:27:52 +01:00
Eskil Abrahamsen Blomfeldt
a0c21829ea Android: Fix QSideBar test
On Android, the HOME and TMPDIR environment variables both point
to the application sandbox, whereas the QSideBar test assumed
they were different. We work around this simply by creating
a new directory and using this as the test dir in place of the
home directory.

Change-Id: I67e01926b901ddf237b05aff116d30b6c7885535
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-16 09:27:45 +01:00
Eskil Abrahamsen Blomfeldt
9a34b69b7d Android: Skip QProcess_and_GuiEventLoop test
This requires building a command line tool and running it using
QProcess, which is not a supported deployment option on Android.

Change-Id: I795374bf809a8e4d8634a55f5ebf1699ee9745d1
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-01-16 09:27:37 +01:00
Eskil Abrahamsen Blomfeldt
1ee6fdc72c Fix QRawFont test when used with bundled FreeType
The auto-hinter in the FreeType version bundled in Qt gives
slightly different advances on some glyphs. As noted in
the removed code, this was already observed on Windows and QNX,
and recently also on Android.

I'm sure it could also happen on platforms using the system library
if the system library was the same version as the one bundled in Qt.
Instead of expect-failing the test, we simply accept both the
observed results as valid.

Note that we need to accept 9 as a result for the default hinting
preference on all platforms, not just Windows, since the default
hinting preference in FreeType can be a system setting.

Change-Id: I3cc0f33f0f66dd64419770b37c10dee457706b5e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-16 09:27:29 +01:00
Eskil Abrahamsen Blomfeldt
b4031387f9 Android: Fix QImageReader test
The files for the test have to be included in a qrc to be available on
Android.

Most of the image files are already in a qrc, but a couple were missing.
We add this in a separate qrc to avoid interfering with the tests on
other platforms.

Change-Id: Ibb24f5015a1aba4d5622e14f7aae80bc18611ec4
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-16 09:27:15 +01:00
Rainer Keller
997b040310 Autotest: Find all autotests due to changed naming conventions
The algorithm searches for all executables in search path starting with
"tst_". Tests are not named like the folder they are contained in
anymore.

Change-Id: I360f293e43e30292fe0ae6230fd3ec7abf3d632d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-01-16 08:14:55 +01:00
Rainer Keller
f6a59f8def Benchmarks: Build gui benchmarks only when gui module available
Change-Id: I57fc2f09a4e31e379c256dfe3f5d7546cdcf2b4b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-01-16 08:14:49 +01:00
Marc Mutz
ba7653fb74 qtest_widgets.h: add support for pretty-printing QSizePolicy
... in QCOMPAREs.

The implementation is hidden in a nested Internal namespace that retrieves
the strings without strdup()ing. That makes it easier to compose these
functions as there is no need to delete character arrays when using them.

The public interface (which qstrdup()s) is implemented on top of these.

[ChangeLog][QtTest] QCOMPARE now pretty-prints QSizePolicy{,::Policy,::ControlType{,s}}.

Change-Id: Ib03d969847e5a12474c71a7921366b400025f680
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-16 03:12:59 +01:00
Thiago Macieira
bbded12df3 Update QFileSelector to use QSysInfo better
This reduces a bit of string duplication by relying on the constants
defined in qglobal.cpp and detection via uname(2), in addition to adding
the Linux distribution name as a selector.

Change-Id: I64a46a0fc552c399db787125b1b32aae5c50056f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-01-16 03:11:51 +01:00
Friedemann Kleint
23f663cad6 Fix compilation of manual Open GL tests with Dynamic GL.
Change-Id: Iffd57f26dfc9d6a00cab855270207fc4da7eb1ab
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-01-15 15:35:11 +01:00
Thiago Macieira
63ca2846e1 Fix compilation with older MSVC: use qIsNan instead of isnan
isnan is C99 and POSIX.1, which the older MSVC do not support. Use the
Qt equivalent.

Change-Id: Ic5d393bfd36e48a193fcffff13b8679cb83d12db
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-15 08:40:14 +01:00
Tobias Koenig
7eafe74804 Haiku: Fix compilation of qarraydata unit test
On Haiku the compilation failed with error:
"undefined reference to 'bool QTest::qCompare<unsigned long, unsigned int>
 (unsigned long const&, unsigned int const&, char const*, char const*, char const*, int)'"

Change-Id: I0daf2e6029898cb6c3d7da9d603aa1ea533aa829
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-14 05:37:43 +01:00