Commit Graph

5267 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
8ac63a3323 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I556be99cc7ad3fc6f7177542b7444269616a7478
2015-03-04 13:44:29 +01: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
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
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
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
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
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
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
Oswald Buddenhagen
d34353a065 Merge dev into 5.5
Change-Id: Id6dbbbfc542c214fe695c6795c6aaf23aedc1cd1
2015-02-23 11:24:07 +01:00