Commit Graph

6800 Commits

Author SHA1 Message Date
Edward Welbourne
b5695bd5be Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
2016-07-04 15:58:39 +02:00
Thiago Macieira
4f3eb66173 QUrl: Test that we do correctly accept valid schemes
... and reject invalid ones. There was one error: we accepted schemes
starting with pluses, dashes and dots.

Change-Id: Ie585843cfb684bc3b6e3fffd145cfe12227ec4ad
Reviewed-by: David Faure <david.faure@kdab.com>
2016-07-02 16:36:50 +00:00
David Faure
1af4916e11 QTime: restore Qt3 compatibility in the QDataStream operators
A Qt5 program writing a null QTime() using setVersion(QDataStream::Qt_3_3),
and then a Qt3 program reading that, would lead to a weird QTime,
with isNull=false, isValid=false, hour=1193, minute=2, second=47, ms=295.

This commit restores interoperability, by writing out the expected value
(0) for a null QTime rather than the -1 value used by Qt4 and Qt5.

Change-Id: Icde468a8f6fc9434ef7018296725819b44d672af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-07-02 08:13:44 +00:00
Alex Trotsenko
3c93286f08 QDataStream: unify deserialization of containers
Serialization of the Qt container classes is accomplished by breaking
up the data into primitive units. On the receiver side, these units
should be read atomically to guarantee integrity of the container.

Deserialization procedures for QHash and QMap were already implemented
in accordance with this strategy and have the following behavior:

 - a previously latched error status is saved for the caller. This
   overrides possible different errors in the current read. This
   is consistent with the treatment of primitive types.
 - if an error occurs during the deserialization, the container is
   cleared.

To make the API consistent, this patch adjusts the behavior of QList,
QLinkedList, QVector, and QSet deserialization. On the implementation
side we accomplish this with a private StreamStateSaver RAII class that
consolidates the handling of the stream status for all containers.

[ChangeLog][Important Behavior Changes][QtCore][QDataStream] Incomplete
reads of Qt containers are now handled same way as for primitive types,
meaning that previous errors are latched.

Task-number: QTBUG-54022
Change-Id: I5c77257fe2a4637e8a7e6cf3cd43091c8469340e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-07-01 16:08:41 +00:00
Friedemann Kleint
fbe67f06bc Diaglib: Build DebugProxyStyle only when QtWidgets are used
Change-Id: Iba1ca731ac569db12211a93f65583d73ffcfce91
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-01 09:25:42 +00:00
Friedemann Kleint
2714d94ff4 Fix tst_QNetworkReply::qtbug45581WrongReplyStatusCode() on Windows
The file is read using CRLF line convention on Windows.

Task-number: QTBUG-24226
Change-Id: Ie08fa603e29c80a42de4bfbfd1f4237f53c22b98
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-06-30 07:07:11 +00:00
Błażej Szczygieł
e2665600c0 xcb: Send expose event while shrinking windows
Send synthesized expose event while shrinking the QWindow. This fixes
the regression which can break some applications which need the paint
events while shrinking the QWindow.

Added auto test.

Task-number: QTBUG-54040
Change-Id: Iaa992abba67f428237fa12c6cae56592b8fcadb0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
2016-06-30 06:51:48 +00:00
Liang Qi
e32f1a4d61 Merge remote-tracking branch 'origin/5.6' into 5.7
And blacklisted a few tests in tst_QUdpSocket.

Conflicts:
	src/android/jar/src/org/qtproject/qt5/android/QtNative.java
	src/corelib/global/qglobal.cpp
	src/corelib/global/qsystemdetection.h
	src/corelib/io/qfileselector.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
	tests/auto/network/socket/qudpsocket/BLACKLIST

Task-number: QTBUG-54205
Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
2016-06-20 08:00:26 +02:00
Liang Qi
c4e472ea10 Merge remote-tracking branch 'origin/5.7.0' into 5.7
Conflicts:
	src/corelib/tools/qsimd_p.h

Change-Id: I7c6bfc5873d97ad7f51a540dd9c18b9359dde59f
2016-06-16 07:30:02 +02:00
Eirik Aavitsland
c2b7841843 Finally fix crash in inplace-modified data-constructed images
Avoid all inplace modification of images using external data
buffers. Since the QImage methods are documented to create a
(modified) copy, there is afterwards no API requirement on the
lifetime of the data buffer.

This patch supersedes 509bc7e59c

Task-number: QTBUG-53721
Change-Id: I3ccc01619eb61d8630104449394e0b76df0af695
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-06-15 12:55:16 +00:00
Alex Trotsenko
3c87c82e52 QDataStream: do not lose error status while reading containers
Otherwise, the code:

  ds >> s >> hash;

could set the stream status to ReadPastEnd, while deserialization
of the string is failed with ReadCorruptData status.

Proposed solution is to restore a previously latched error status
unconditionally in accordance with QDataStream::setStatus() docs.

Change-Id: Id3a7dccf709b02e5b018efb48d7647ee48fe5124
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-06-15 07:43:54 +00:00
Timur Pocheptsov
17143bf47c tst_QUdpSocket - remove insignificance
This is the second attempt to remove 'insignificant' from UDP socket test to:
- make changes ending up in regressions more difficult (hopefully impossible)  to merge
- switch to BLACKLIST if needed
- make flaky tests more visible.

For now this 'back to significant' will be accompanied by extended BLACKLIST.
New in BLACKLIST:
* OS X - datagram size-related problems (fixed in 5.7)
* OS X - multicastLeaveAfterClose - will probably stay BLACKLISTED,
  seems to be a Darwin's quirk, can be fixed in OS X >=  10.10.
* windows ...

tst_QUdpSocket::echo seems to fail randomly on OS X/linux and
it looks like it fails at the same time on different machines,
should be something server-related (a guess only).

Change-Id: Ib344348ffab03fab1b9309b80449a04d8ce247c6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-06-14 11:13:50 +00:00
Jesus Fernandez
8e88937811 Fix UNSIGNED values in QMYSQL
The unsigned flag in columns was ignored when creating the list of
bound values in a mysql table. So the result iteration with
QSqlQuery::next stops after the first wrong truncated value.

[ChangeLog][QtSql] Fixed QSqlQuery::prepare value truncation error when
using UNSIGNED values in a MySQL database.

Task-number: QTBUG-53969
Task-number: QTBUG-53237
Change-Id: I10d977993445f2794f1dd8c88b2e83517ef524f3
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-06-14 11:13:11 +00:00
Timur Pocheptsov
23173c725c QSslSocket (OpenSSL) - handle abort/close on sslErrors emitted
If a user's code, attached to sslErrors signal, calls abort/close
or disconnectFromHost but our SSL socket was configured not to verify a peer,
no need to continue handshake after calling checkSslErrors
(and finally crashing on invalid 'ssl' pointer).

Task-number: QTBUG-53906
Change-Id: I7f185511d278f9d6f16e7d6c5ba424707141459c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-06-14 07:29:01 +00:00
Friedemann Kleint
caa4e44937 tst_QTcpSocket: Replace insignification on Windows by BLACKLIST.
Partially reverts f3939d943e.

Task-number: QTBUG-52714
Task-number: QTBUG-49332
Task-number: QTBUG-49333
Change-Id: I1f1b3278134b1e6156c0cb7006d396154c776a46
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-06-10 21:48:54 +00:00
Liang Qi
cbe332405a Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	configure
	mkspecs/macx-ios-clang/features/default_pre.prf
	mkspecs/macx-ios-clang/features/sdk.prf
	mkspecs/unsupported/freebsd-g++46/qplatformdefs.h
	src/widgets/styles/qgtkstyle.cpp
	tests/auto/corelib/io/qdiriterator/qdiriterator.pro
	tests/auto/corelib/io/qfileinfo/qfileinfo.pro

Change-Id: Ia943555d1e59234a66f7dc65bdfda838e40001b5
2016-06-10 23:27:10 +02:00
Friedemann Kleint
d2c6294bd5 Diaglib: Add class LogWidget.
Add a class to display debug messages, providing convenience functions for
installing and formatting parameters like indentation. It prints a startup
message containing relevant information about Qt.

Change-Id: Id0a19adbb5953a6ded1a8e692f242b63748e7273
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-06-09 20:16:47 +00:00
Thiago Macieira
0a78d918f0 Replace qAllocMore with a pair of more useful functions
The first is "exact", not "more": qCalculateBlockSize. It ensures that
there's no overflow in multiplying, adding the header size or when
converting back to an int.

The second is the replacement for qAllocMore: it calculates the block
size like the first, but increases the block size to accommodate future
appends. The number of elements that fit in the block is also returned.

Task-number: QTBUG-41230
Change-Id: I52dd43c12685407bb9a6ffff13f5da09f816e667
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-09 15:32:14 +00:00
Joerg Bornemann
bd4344a0bd Fix qplugin autotest on Windows
Since Qt 5.0.0 we never built the test plugins on Windows, because we
checked for the existence of QtCore[d]4.dll, and the actual test does
not complain if it cannot find any plugins.
Use the right conditions to check for debug/release Qt builds on
Windows. Use subdirs dependencies on every platform and then actually
pass the right variable to SUBDIRS. Clean up the pro file while we're at
it.

Change-Id: I099f30afd445fbf43dc5677d256ffe55b27639b3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-08 19:40:29 +00:00
Friedemann Kleint
6c0783d107 Revert "Insignifify qfileinfo on Windows, like QDir".
This reverts commit 55655abfaf.

The crashes in release mode cannot be locally reproduced.

Change-Id: I4e7b1defbeac5d5512b2fa82a367d2e04e3c37a4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-06-08 19:05:46 +00:00
Friedemann Kleint
19def3d8f1 Revert "Insignifify qdiriterator test"
This reverts commit b373d183de.

The crashes in release mode cannot be locally reproduced.

Change-Id: I38ff5e9e045cff0e94e24ca07fb6e18e88b677c7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-06-08 19:05:38 +00:00
Friedemann Kleint
36ffe18f05 Re-enable tst_QDir on Windows.
Partially revert f3939d943e.

Change-Id: I67e4d8973bc18d9cd77750c6379221d34e9484b3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-06-08 19:04:36 +00:00
Luca Bellonda
767319a5aa Add support for 8bit encodings not ASCII compatible in QXMLStreamWriter.
When using a 8 bit encoding to write a file, a test discovers if the
encoding is really ASCII compatible by examining a letter and one of the
XML reserved characters. EBCDIC, in the current base, was not well
handled.

[ChangeLog][QtCore][QXmlStreamWriter] Fixed a bug that prevented the
generation of valid XML files when using encoding with 8 bit per
character but not ASCII compatible. QXMLStreamWriter generated XML
markup using always ASCII in this case.

Change-Id: I9c86a122dd91b2290d50c358638442f99777d4ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-06-08 18:50:25 +00:00
Marc Mutz
5a15545ee2 QDebug: fix streaming of QChars
Commit 9ef3ff30 introduced a new function, putUcs4(), to
output QChar, char16_t, char32_t as a, possibly escaped,
character literal, but got the order of stream modifiers
wrong. Instead of applying the field width to the 'ucs'
streaming, it applied it to the prefix '\u'. The same
problem exists for the pad char, leading to the result
   '00\ue4'
for a QChar containing
  ä (LATIN SMALL LETTER A WITH DIAERESIS)

Fix by reordering the elements streamed so that the
prefixes come last.

Added a test.

Change-Id: I6eaa0586501b9e780aaa3bb5dcec0e5c2f86a219
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-06-08 18:29:38 +00:00
Friedemann Kleint
df3f685826 tst_QFileSystemModel: Remove Win32LongFileName().
Modern SSD drives no longer have short file names enabled, causing
the test to fail.

Task-number: QTBUG-29403
Change-Id: I2e9866d8f8a6ed3df9d2dc6630b8cfa47ade0728
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-06-08 04:09:48 +00:00
Friedemann Kleint
ae0a2fe041 Rewrite test tst_QDir::cdBelowRoot() to be data-driven.
Limit the macro #ifdefery and allow for more test cases.

Task-number: QTBUG-53712
Change-Id: I2c185efc7c3b8fcd0217d2021bd98ab6044b5aee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-06-08 04:08:34 +00:00
Hannah von Reth
ca434d0c20 Enable testStyleOptionInit for all styles and fix affected styles.
Change-Id: I7cb759445342ecb58d5187ddd4a22e41fdea084a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-06-06 13:12:14 +00:00
Thiago Macieira
f8b5142e30 Fix race condition in tst_QDBusConnection::pendingCallWhenDisconnected
The test sent a message and hoped that the "delete server" would cause
the server object in the QDBusConnectionManager thread be deleted before
it could receive and process the message. That's racy, because on some
CI machines, it did and then sent back an error reply indicating the
object sought was not found.

Instead, let's use a child process that we can kill to make it exit at
the right time.

I've chosen to use dbus-daemon itself, because that lets us test the
actual conditions that triggered the original bug: the daemon getting
killed during a desktop session shutdown on Linux.

Change-Id: I87e17314d8b24ae983b1fffd1454483aea87c921
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-06-06 11:39:53 +00:00
Liang Qi
57057f76ad Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	.qmake.conf
	config.tests/unix/nis/nis.cpp
	mkspecs/unsupported/freebsd-g++/qplatformdefs.h
	src/corelib/tools/qdatetime.cpp
	src/corelib/tools/qsimd.cpp
	src/corelib/tools/qsimd_p.h
	src/network/access/access.pri
	src/network/access/qnetworkreplynsurlconnectionimpl.mm
	src/network/access/qnetworkreplynsurlconnectionimpl_p.h
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/printsupport/windows/qwindowsprintdevice.cpp
	tests/auto/corelib/kernel/qobject/tst_qobject.cpp
	tests/auto/network/access/qnetworkreply/BLACKLIST
	tests/auto/widgets/widgets/qopenglwidget/BLACKLIST

Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
2016-06-06 09:04:55 +02:00
Friedemann Kleint
fd70978693 Diaglib: Extend class information for QWidget dumps.
Output the class hierarchy until a base class within QtWidgets is found.

Change-Id: I0ecee22e2ead1dea8b39cce8ca2f0739290aac22
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
2016-06-04 18:49:27 +00:00
Friedemann Kleint
95f1f6f719 tst_QTemporaryFile: Run in temporary directory.
The test leaks a file (named qt_...xxx) in QDir::tempPath(). Moreover,
when tests fail, it can happen that more files are leaked and subsequent
runs do not recover since the check for non-existence of those files fails.

Change-Id: Iaea6d09ee7c271903a1b9c63e263c19f9e90bba9
Reviewed-by: David Faure <david.faure@kdab.com>
2016-06-04 18:48:52 +00:00
Friedemann Kleint
23bed9f820 Remove tst_QWidget::immediateRepaintAfterShow().
It tested whether a paint event was received when calling QWidget::repaint()
right after QWidget::show() without waiting for the window to be exposed.

This caused a QEvent::UpdateRequest to be sent, which ended up in
QWidgetBackingStore::sync() which returns after checking
QWidgetBackingStore::discardSyncRequest(), since Qt::WA_Mapped is not set
on the non-exposed widget.

The test passed on Windows since it contains one call to
QCoreApplication::processEvents() which causes the the initial WM_PAINT
message to be processed in QWindowsWindow::handleWmPaint() which calls
QWindowSystemInterface::flushWindowSystemEvents() and causes Qt::WA_Mapped
to be set. This seems counter to the intention of the test.

Remove the test since it won't pass anymore in Qt 5 unless Qt::WA_Mapped is set.

Task-number: QTBUG-26424
Task-number: QTBUG-38327
Task-number: QTBUG-39842
Change-Id: Iede026d52825dcf1f2e9014a316d26d260309214
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-06-04 18:47:54 +00:00
Morten Johan Sørvig
22667483e1 Blacklist modalDialogClosingOneOfTwoModal on OS X
Passes locally (on 10.10), but seems to have become
unstable on the CI system.

Task-number: QTBUG-53790
Change-Id: I0432fca4121b97bcdd6cec529fc4e148dfb8c1ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-06-04 18:36:04 +00:00
Thiago Macieira
3b3ca5dead tst_QObject: Test if the new connect style works with virtual bases
Change-Id: I87e17314d8b24ae983b1fffd1453abe1e395bbd1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-06-02 20:52:56 +00:00
Liang Qi
688f70634c Merge remote-tracking branch 'origin/5.6.1' into 5.6
This merge also blacklists a flaky tst_QGL::clipTest test on
OpenSUSE 13.1.

Conflicts:
	src/network/socket/qnativesocketengine_winrt.cpp
	tests/auto/opengl/qgl/BLACKLIST

Task-number: QTBUG-53133
Change-Id: I14b431aa5a189b7dd1d3e2dfff767d15df20fde3
2016-06-02 06:01:25 +02:00
Alexandru Croitor
a1de7c40f4 Blacklist tst_QOpenGLWidget::stackWidgetOpaqueChildIsVisible test.
It fails randomly on Windows, possibly due to timing issues.

Change-Id: I0ef74f203455eb4ea8aeee4c8fc9bf1fbf6fb8ff
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-06-01 11:17:31 +00:00
Eskil Abrahamsen Blomfeldt
8fb29ed259 Don't alter input string in QTextLayout with ShowLineAndParagraphSeparators
When ShowLineAndParagraphSeparators was set, we would replace the
separator character in the user's string in some cases, since we never
detached from the input string and just const_cast the pointer to the
shared buffer.

[ChangeLog][QtGui][Text] Fixed bug where a QTextLayout with
ShowLineAndParagraphSeparators would modify the layout's input
string.

Task-number: QTBUG-42033
Change-Id: I92f9100b750f16e52b38b718245c13e5c4a0ebb9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-06-01 10:04:02 +00:00
Milla Pohjanheimo
d11abc8bd7 Blacklisting a flaky tst_QGL::clipTest test on OpenSUSE 13.1
Based on discussion with Laszlo, we are blacklisting this test.

Task-number: QTBUG-53133
Change-Id: I08a5192ebcefd7b093c79872e0dfaddb794cab57
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-06-01 04:36:54 +00:00
Jake Petroules
a160bd4fcc Fix bugs causing Thin font weights to be ignored or mishandled.
Task-number: QTBUG-53196
Change-Id: If12b3cab3d8de5e0e452fca844b0a484c29e9e86
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-06-01 02:29:51 +00:00
Friedemann Kleint
ed08e3be34 tst_QPlainTextEdit/tst_QTextEdit: Do not output unprintable characters.
The test selectWordsFromStringsContainingSeparators() duplicated
in boths tests caused tab and Nbsp characters to be output to the
log, which upsets editors.
Use an array of ushort instead of a wasteful QStringList and
output the hex codes for the unprintable characters.

Change-Id: I08724268f376b4c0da492b4109570e44f7d4a3fb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-05-31 11:46:36 +00:00
Robert Loehning
08f0253c4a Add manual test for shortcut using implicit AltGr
In German layout, "Ctrl+]" is "Ctrl+AltGr+9".

Task-number: QTBUG-51848
Change-Id: I8c05c13a4d46c0818ce4f56ce476c5310a677af2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-05-30 15:30:57 +00:00
Thiago Macieira
2cf099e9f6 tst_Moc: restore signals/slots/emit to the Q_UPPERCASE values
The previous definition of signals does not need to be "public". It may
have been something else.

Change-Id: Id69569111e7d4e619e22ffff144b4855e6acdbef
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-30 14:02:19 +00:00
Alexandru Croitor
00061b968d Fix opaque texture-based widgets not being always shown.
Whenever a regular QWidget contains a child render-to-texture widget
(like a QOpenGLWidget) that is opaque (attribute
Qt::WA_OpaquePaintEvent is set) and completely covers the parent
geometry, the child widget would not be shown.

This happens because QWidgetBackingStore::doSync contains a check to
see if an opaque child completely covers its parent, in which case it
does not draw the parent, and only draws the child.

This is an issue if the widget is actually a texture-based one, because
for it to be seen on screen, the parent widget has to be redrawn with a
proper blending mask, so that the rtt widget gets properly composed
into the place where the mask is.

The fix consists in keeping the parent widget being marked dirty, in case
it has an opaque texture-based child that completely covers it. This will
force a redraw of the parent widget with a proper blending mask.

Change-Id: If1feec04b86bff2c49158b8d72f175cec252dea1
Task-number: QTBUG-52123
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-05-30 12:35:37 +00:00
Thiago Macieira
32c301e229 Fix crash when connecting a non-PMF with Qt::UniqueConnection...
...if a PMF connection had already happened. Since UniqueConnection
isn't implemented for non-PMFs (functors and lambdas aren't comparable,
even if static member functions or non-member functions are), we pass a
null pointer for comparison argument. The disconnect() code already
protected against a null pointer there, but not the connect code path
with Qt::UniqueConnection

Change-Id: I87e17314d8b24ae983b1fffd145324beced0494d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Dario Freddi <dario.freddi@ispirata.com>
2016-05-30 00:19:39 +00:00
Thiago Macieira
0f559a2d99 Force the use of the C++11 alignof keyword instead of an extension
If the compiler supports C++11 alignof, let's use it. No point in
perpetuating the use of __alignof__ or __alignof.

There's a fallback implementation in qglobal.h that works even without
compiler extensions. We can't drop it just yet (alignas is not a
required C++11 feature), but at this point I doubt that fallback is used
anywhere anymore.

The tst_compiler test was wrong to use alignof(variable). That's not
permitted by the standard nor would it work with our fallback
implementation. MSVC 2015 enforces this, but ICC, GCC and Clang don't.

Change-Id: Ifea6e497f11a461db432ffff1448abfa86672c63
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-29 18:45:13 +00:00
Timur Pocheptsov
f9b7385e24 tst_qsslsocket::protocolServerSide - blacklist on RHEL 7.2
protocolServerSide test fails with 'ssl3-any' and 'tls1.0-any' combo
on RHEL 7.2 with OpenSSL v1.0.1e-fips, it would work as OPENSSL_NO_SSL2
code-path, but OPENSSL_NO_SSL2 is not defined, so socket is in state
connected while it's expected to be unconnected.

Task-number: QTBUG-53608
Change-Id: Ib321b95129a6ab5b0691b40cb4acc612125633b2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-05-26 10:47:42 +00:00
Timur Pocheptsov
84f8203e38 tst_qsslsocket - re-structure the code
setEmptyDefaultConfiguration - this test (and this was stated explicitly
in comments!) must be the last test to run, otherwise, it can make subsequent
tests fail.

-exitLoop must be in 'protected slots' section not to be executed as a test,
since ... it's aux function, not a test.

Task-number: QTBUG-53608
Task-number: QTBUG-53603
Change-Id: I49d6d57ba927ecc4f20ae2d9325ad02fa46b0922
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-05-26 09:40:08 +00:00
Edward Welbourne
07667b4390 tst_QNetworkReply: Un-blacklist recently fixed test.
A recent fix now makes
authenticationCacheAfterCancel(http+socksauth)
work again, so un-blacklist it.
Added a helpful comment while I was at it.

Change-Id: I2d7eae8d80c12957d22659a82e5072301735c41f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-25 11:12:00 +00:00
Thiago Macieira
e9041c7fc1 Fix parsing of tzfile(5) POSIX rule zone names with bracket quotes
POSIX.1-2001 allows quoting a zone name so that it can contain other
characters besides letters, by enclosing it in angle brackets ('<' and
'>'). This hadn't been used until recently (tzdata2016b), when the
Asia/Barnaul rule started using a zone name "+07" (the name variable
contained the value "<+07>-7").

Thanks to Paul Eggert for reporting and investigating the root cause.

Task-number: QTBUG-53071
Change-Id: Id5480807d25e49e78b79ffff1449bc410776cb66
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-24 19:31:40 +00:00
Laszlo Agocs
61521b64a4 Avoid missing paints when resizing GV with QOpenGLWidget viewport
There is nothing guaranteeing there will be a paint request after
resizeViewportFramebuffer() is called. However we must not be left
with a framebuffer with uninitialized content. So trigger an update.

Include also a half-hearted autotest. QOpenGLWidget (or QGLWidget)
viewports have not been autotested at all. Try to verify that it
is functional at least, even if we cannot check the actual output.

Change-Id: I34d78fe32e94c39dad919216b5a4f4bb2aea3cc2
Task-number: QTBUG-52419
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2016-05-24 19:16:46 +00:00
Friedemann Kleint
65ae3de2e1 Fix tst_QListView::setCurrentIndexAfterAppendRowCrash().
The test was half-ported from Qt 4 and #ifdefed out depending
on WINVER. When it became active, it failed since it queries the window
handle too early in the process.

Move the code sending the message into showEvent() to ensure a window
handle exists and parent the listview properly to prevent a leaking
toplevel.

Change-Id: I74aa9ddfd0e88dd31e9258400fc3e473b6e0d92e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-05-24 17:54:13 +00:00
Maurice Kalinowski
8e8bd90e44 Fix compilation without process support
Change-Id: I88ef96bf15f40e459bacc4b2abe4dfe84e257495
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-20 10:37:18 +00:00
Gabriel de Dietrich
1acb29c3dd QMenu auto-test: Add test for two-level tearable menus
This has been fixed in 5.6.1 but we can afford the extra test
to guard against regressions.

The setup for this test is two menus, one parent of the other.
The submenu is tearable. We open the parent menu, open its
submenu and then move the mouse cursor straight over the
submenu's tear-off area. The submenu should stay open even
after a short delay.

Change-Id: Ia8ad326d78dde31b6dd91b0ebacf0db1898715d4
Task-number: QTBUG-53068
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-05-19 18:17:40 +00:00
Liang Qi
818014b449 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	configure
	src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
	src/network/access/qnetworkaccessmanager.cpp
	src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h
	src/widgets/widgets/qlineedit_p.cpp
	src/widgets/widgets/qlineedit_p.h
	src/winmain/winmain.pro
	tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
	tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
	tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
	tools/configure/configureapp.cpp

Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
2016-05-19 12:55:27 +02:00
Błażej Szczygieł
bc410cc706 QtWidgets: Reduce paint events when resizing native widget
This patch reduces paint events by removing code which sets native
widgets dirty in QWidgetWindow::handleExposeEvent. Native widgets are
also marked dirty in QWidgetPrivate::drawWidget, so it is enough for
proper painting.

This restores Qt4 behavior when one resize means one repaint for native
widgets. Without this patch the native widget is marked as dirty on
every expose event, so one repaint is from syncBackingStore and second
(or more) is from marking the widget dirty explicitly.

This patch improves performance of native widgets and it also reduces
locks when paint event is v-synced, e.g. on OpenGL swap buffers or on
any other technology like VDPAU, VA-API, etc.

Added autotest for checking number of paint events for native widgets.

Task-number: QTBUG-50796
Change-Id: I4e1649069e2e73d15b038fd1834d0551915252ee
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-19 10:11:27 +00:00
Liang Qi
640441882d Merge remote-tracking branch 'origin/5.6.1' into 5.6
Conflicts:
	src/network/socket/qnativesocketengine_winrt.cpp

Change-Id: I8edb72f8ba958d80c3d7993b3feaaae782ca8d9c
2016-05-19 06:31:06 +02:00
Felix Bourbonnais
b627dd2c24 QMenuBar: nested parenting fix
QMenuBar now receives a parent changed event for each of its parent,
grand-parent, ... This fixes a crash caused by an invalid QWidget
pointer and makes sure the keyboard shortcuts events are relayed to the
menu bar in all parenting/re-parenting cases by installing an event
filter on each parent

Task-number: QTBUG-53205
Change-Id: I419e6cbc52e28a67fb08a848a7161b4cb8ae4ae5
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
2016-05-18 17:40:11 +00:00
Olivier Goffart
27425e62c0 Moc: fix crash when a file ends with \\\r
make the 'cleaned' more robust by making sure we do not read past the
buffer in some cases. We must also use resize and not reserve on the
outpt buffer because reseve is meant as a hint and we are not supposed
to write past the size of the QByteArray even if it is reserved.

[ChangeLog][moc] Fixed crash on file ending with \\\r

Task-number: QTBUG-53441
Change-Id: I901e6c0ffc7f8877de3d07fd08cf26495461d294
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2016-05-18 10:34:13 +00:00
Olivier Goffart
45eba73492 Fix QVariant conversion to an enum type.
QVariant::canConvert<Enum> was returning true for everything can can be converted
to integer, but not for integer itself. That's because in QVariant::canConvert
we set the targetType to Int of it's an enum, but the Int->Int case was not
on the conversion matrix. So this commits adds it to the conversion matrix
and now QVariant::canConvert<Enum> returns consistently true for int itself.

But even tough canConvert returned true, it did not actualy do any conversion
to the enum type itself. Fix that by handling the case properlt in 'convert'

[ChangeLog][QtCore][QVariant] Fixed QVariant::canConvert and conversion from
integer types to enumeration types.

Task-number: QTBUG-53384
Change-Id: I6ac066f3900e31bfcea7af77836ddfc7730bd60b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-16 15:58:28 +00:00
Friedemann Kleint
474af0a61d QWidget::mapTo/FromGlobal(): Rewrite using a QTransform.
Introduce a function going up the widget hierarchy determining a QTransform
for mapping the coordinates applying the transformations of any QGraphicsView
instances found. In mapFromGlobal(), use the inverse of it. This fixes the
case of widget hierarchies embedded into QGraphicsView with transformations.

Increase fuzz in the tests due to float rounding errors.

Task-number: QTBUG-41135
Task-number: QTBUG-50030
Task-number: QTBUG-50136
Task-number: QTBUG-52507
Change-Id: I507e0bccd546250fe9c2d1b74ef38657d61490b4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-05-14 06:51:10 +00:00
Thiago Macieira
a26435d65c Print the QStorageInfo dump on test start
So we know what we're looking at if there's a test failure. This is like
QNetworkInterface.

Change-Id: Id75834dab9ed466e94c7ffff1444bf51f615e944
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-14 01:21:27 +00:00
Eskil Abrahamsen Blomfeldt
186d391f25 Work around QFont bug in QFontDialog test
The QFontDialog test will currently fail for some PCF bitmap fonts
because the list of smooth sizes it uses to populate its size list
contains unsupported sizes. We work around this by adding
QEXPECT_FAIL when we detect that the failure is going to happen.

Task-number: QTBUG-46056
Task-number: QTBUG-53299
Change-Id: Ia665cca220f3622405d1a2336e8d587545cccbc6
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-13 21:08:07 +00:00
Timur Pocheptsov
ae975859f9 Revert "tst_qudpsocket - remove insignificant"
This reverts commit 11ad50074b.
Unfortunately, udpsocket strikes back this time on OS X < 10.10 -
never seens these test failing before. Since this prevents 5.6->5.7
merge, I have to revert it until the problem investigated/fixed on OS X.
Alas :(

Change-Id: I52f6512d88c25d2e3071cb845e91faefbd455e27
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-13 19:07:56 +00:00
Eirik Aavitsland
5316befba2 ICO image format: fix regression in writing when size >= 256
In commit c6c9304, the earlier size limit of 128 was raised to the
format's defined maximum of 256. But the required special storage of
this size in the image structures was not implemented. Hence,
attempting to store such big icons would result in invalid image
files.

Fix the size storing details, and add some autotests of ico format
writing since that was practically uncovered.

Task-number: QTBUG-53259
Change-Id: I00e17a04e90c32dcf1124ba5adaf53728fb74dc7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-13 04:37:15 +00:00
Jesus Fernandez
2ac3fab45f Fixed crash in QAuthenticator::operator==
[ChangeLog][QtNetwork][QAuthenticator] Fixed crash when
comparing a initialized QAuthenticator with an uninitialized
QAuthenticator.

Task-number: QTBUG-53338
Change-Id: Ib8b732b9c65c02ee542885e5d6fe9bd1589a6b1a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-13 03:58:06 +00:00
Eskil Abrahamsen Blomfeldt
d70205cd2b Remove dead code from tst_QFont::exactMatch()
All this code was skipped on all platforms, so keeping it is just
confusing.

Change-Id: I405d2e791b22a2494fe5ccac6e3bf08905dc4e5a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-12 10:13:58 +00:00
Eskil Abrahamsen Blomfeldt
78eeb6b066 QFont::exactMatch() should return false for aliases
This is a partial revert of 992f233c in Qt 4 repo. The rest of the
change cannot be reverted, since it added public API, but that
API might be useful anyway.

The patch was wrong, basically. QFont::exactMatch() should not claim
that you can get an exact match for a typeface alias. It also introduced
some weird inconsistencies: For instance, if the first font the alias
resolved to in FontConfig did not exist, then exactMatch() would return
false, even if it then resolved to the next one which existed. This
caused a test failure on OpenSuse, where the preferred font for "sans"
is Arial, which doesn't exist, so Roboto will be used instead.

[ChangeLog][QtGui][Important Behavior Changes] QFont::exactMatch() now
returns false when the provided typeface is an alias.

Task-number: QTBUG-46054
Change-Id: I7532d2879b492544620aa0d1d87dd493a4923af9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-12 10:13:42 +00:00
Mitch Curtis
e64b2234e8 QImage::setPixelColor: warn about invalid colors
Task-number: QTBUG-52142
Change-Id: I9f390bd332f8edabaece75a6b36830c691ff4b9e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-05-11 07:21:02 +00:00
Marc Mutz
a5159cc50a QJsonObject: add some overloads taking QLatin1String
QXmlStreamReader also has QLatin1String overloads, which
greatly benefits parsers, since the vast majority of keys
in both JSON and XML are US-ASCII. This patch adds such an
overload to the JSON parser.

The value() function is all typical parsers need, so even
though many more QJsonObject functions taking QString could
benefit from the same treatment, value() is the single most
important one for read-only JSON access.

Add some more overloads, too, for functions that don't need
more internal scaffolding than value(). Requires adding a
dummy op[](QL1S) (forwarding to the QString overload) so as
not to make

  QJsonObject json;
  json[QLatin1String("key")]; // mutable

ambiguous between const op[](QL1S) and mutable op[](QString).

[ChangeLog][QtCore][QJsonObject] Added value(), op[] const,
find(), constFind(), contains() overloads taking QLatin1String.

Change-Id: I00883028956ad949ba5ba2b18dd8a6a25ad5085b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 21:18:46 +00:00
Alexander Volkov
acf43c17b6 QFileSystemModel: create nodes with correct QFileInfos
Create parent nodes with the corresponding paths, not with
the absolute path of the child node. Otherwise we will get
incorrect QFileInfo at least in the following case:

    QFileSystemModel model;
    model.setRootPath("/usr/bin");
    QModelIndex idx = model.setRootPath("/usr");
    qDebug() << model.fileInfo(idx).absoluteFilePath();

Without the fix it prints "/usr/bin".

It's a regression triggered by 61cefb2f7a
(De-inline QFileSystemModel::fileInfo() and implement it efficiently).

Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808
Task-number: QTBUG-51586
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 20:51:15 +00:00
Oswald Buddenhagen
33c5df2887 decruft project files
the "generated by qt creator" header is not supposed to be checked in.

Change-Id: I7626c0bd16f83d81b3facd216a04e7d505942256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-10 11:12:04 +00:00
Morten Johan Sørvig
7e539002ee Enable movedAndResizedAttributes test.
The test passes on OS X now.

Task-number: QTBUG-8941
Change-Id: I7b57dc30ede7c1ed0bcb8bacb458ea56f222d987
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 10:36:08 +00:00
Morten Johan Sørvig
95b8dfdb6f tst_qwidget: remove sheetOpacity test
Sheets are no longer transparent on newer OS X
versions.

Change-Id: Iaaed5aea9c9b130a5d991acd36717b76c3927cfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 10:26:51 +00:00
Morten Johan Sørvig
7f5e8a5e34 OS X: Remove unified toolbar test.
The Qt 5 unified toolbar implementation does not move
the toolbar to the “non-client” area. This test is
no longer relevant.

Change-Id: Ia32de2260f8ef400a0dc5acf3e5e3ff59083657a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 08:15:09 +00:00
Thiago Macieira
50723bf3d0 Make sure the QDBusVirtualObject virtuals are called in the right thread
Change-Id: I42e7ef1a481840699a8dffff1409e30f191e822f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-09 16:21:50 +00:00
Friedemann Kleint
9f6f06c319 tst_QMdiArea::subWindowActivated2(): Allow for several activated events.
On some X11 window managers, 2 events are received when
hiding/reshowing and activating the window, which became
apparent after 91f536dd71.

Change-Id: I66fdc4f69d87ac898b18d5dfddc957617bb8f916
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 08:40:00 +00:00
Thiago Macieira
d9f6b6d1f8 QStorageInfo: update the detection of pseudo filesystems
Allow tmpfs filesystems to be reported, as they're often usable by the
user, mounted in /tmp and in /run (the fs for $XDG_RUNTIME_DIR).

But disallow anything whose device is not a pathname. This catches most
of everything else that wasn't specifically tested for before, like
virtual fuse filesystems, like GVFS.

Change-Id: I3e15a26e0e424169ac2bffff1417b7cee0f8ec97
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:26 +00:00
Thiago Macieira
b168c6c824 QStorageInfo: fix matching of mountpoints to sibling directories
The path "/usrfoo" starts with "/usr", so if you tried to get
QStorageInfo("/usrfoo") when "/usr" is a mount point, you'd get the
wrong filesystem.

[ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused QStorageInfo
to report information for the wrong filesystem if there is a mounted
filesystem at a path that is a prefix of the requested path (e.g., it
would report "/usr" filesystem for "/usrfoo").

Task-number: QTBUG-49498
Change-Id: I3e15a26e0e424169ac2bffff1417b7a27cd0132d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-05-09 06:04:21 +00:00
Thiago Macieira
fe23db053a Add an autotest for the QtDBus message spy hook
There's exactly one application that needs this functionality (kded/
kiod), but we should test it too.

Change-Id: Icaa7fb2a490246bda156ffff143d210c6f5f207f
Reviewed-by: David Faure <david.faure@kdab.com>
2016-05-09 05:31:11 +00:00
Thiago Macieira
8de2986a42 tst_QDBusMarshall: make sure we compile on linked, old dbus
If we're linking to libdbus-1, qdbus_symbols_p.h #includes dbus/dbus.h,
which may be old and not #define the Unix FD macros. tst_QDBusMarshall
had the definition for one of the macros but not the other, so add the
missing second one.

Change-Id: Id69569111e7d4e619e22ffff144c35edcd6f348b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-09 05:30:43 +00:00
Vyacheslav Grigoryev
558718ff44 QTableView: Fix selection for reordered or hidden rows/columns
The old code sometimes made incorrect selections when rows or columns were
hidden or moved. It used logical top left and bottom right indexes to create a
selection rectangle. However on moved or hidden cells a wrong rectangle was
made. This fix calculates a simple rectangle without hidden cells and makes use
of the row/column select functionality provided by the selection model, to make
the right selection.

[ChangeLog][QtWidgets][QTableView] Fixed a selection bug when rows or columns were hidden (QTBUG-50171)

Task-number: QTBUG-50171
Change-Id: Id186012af26da7b2051ff5eb1c13e6b7494cca77
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2016-05-09 05:14:38 +00:00
Thiago Macieira
194a56ea79 QTest: Fix printing of values of Q_ENUMs
QMetaEnum::key(n) returns the n-th key, which is not necessarily the one
of value n. For the key of value n, we want QMetaEnum::valueToKey(n).

Change-Id: Ic90fe6b1cbe84978a02fffff141bf4a06074917a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-08 08:57:16 +00:00
Thiago Macieira
e1d0da6526 Fix Clang -Wexpansion-to-defined warning by deprecating QT_SUPPORTS
The C and C++ standards say it's undefined whether the preprocessor
supports macros that expand to defined() will operate as an ifdef.
Clang 3.9 started complaining about that fact.

One solution was to change QT_SUPPORTS to check for zero or one, which
means we need to change the #defines QT_NO_xxx to #define QT_NO_xxx 1.
The C standard says we don't need to #define to 0, as an unknown token
is interpreted as zero. However, that might produce a warning (GCC with
-Wundef), so changing the macro this way is not recommended.

Instead, we deprecate the macro and replace the uses with #ifdef/ndef.

Change-Id: Id75834dab9ed466e94c7ffff1444874d5680b96a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-08 04:25:27 +00:00
Liang Qi
dbef41f43e Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	examples/qtestlib/tutorial5/containers.cpp
	examples/widgets/tools/tools.pro
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/network/kernel/qdnslookup_unix.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/testlib/qtestcase.cpp
	tools/configure/configureapp.cpp

Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
2016-05-06 15:36:44 +02:00
Timur Pocheptsov
11ad50074b tst_qudpsocket - remove insignificant
BLACKLIST should make it, recent regression in QUdpSocket went unnoticed
(first) because of 'insignificant'. We'd like to avoid such regressions
in future (again, using BLACKLIST if needed and fixig the real problem then).

NB: BLACKLIST in this patch was extended to deal with previously unnoticed failures on
Windows and OS X. 'multicast' and related family of of functions on OS X
will probably stay like this (seems to be a Darwin's quirk), datagram
size related tests - fixed in dev or 5.7 (change is in nativesocket engine,
'bytesAvailable').

Task-number: QTBUG-52714
Change-Id: I039b05935a02983ce1648de449907dfa765f7db7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-06 11:59:03 +00:00
Timur Pocheptsov
88c4388022 tst_QWidget: make it stable on OS X
This patch QSKIPs all tests that:
- take to much time sitting in some QTRY_VERIFY or similar before failing
- result in 'not in fullscreen mode' warning (with PASS) - thus completely flaky.
- Where previously determined to not apply to OS X using QT_OS_MAC

The intent is to make the test run-time more reasonable,
both when running the test locally and on the CI system.

Reduce the BLACKLIST - to avoid a 'double elimination' the tests that are skipped now,
should not be BLACKLISTed so that we fix them for good.

Task-number: QTBUG-52974
Change-Id: I34dc2010d0debc6b5b99f2375a6da902b7a17b29
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-05-06 09:07:51 +00:00
Friedemann Kleint
728a1b4f29 tst_QKeyEvent::modifiers(): Ensure test data row names are pure ASCII.
The test used to output random character sequences which contained
terminal control characters. Change it to output plain ASCII and
Unicode syntax for non-ASCII characters.

Change-Id: Ifaa72f50242bd27416a8698a1f5152bc8b902898
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-05-04 13:06:37 +00:00
Morten Johan Sørvig
dec0b15685 Change Q_OS_MAC -> Q_OS_OSX
Q_OS_DARWIN is the general replacement for Q_OS_MAC,
but most/all of the MAC sections in this test are
OS X specific.

Change-Id: Ic54af9d3dce1e1952a57e15b74acdedf2af60c79
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-04 11:23:16 +00:00
Morten Johan Sørvig
2c60125ef9 Add missing Q_DECL_OVERRIDEs
Change-Id: I54552d9fdd0bc8871247246aea1da14848c4f7a0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-04 11:23:03 +00:00
Friedemann Kleint
54781edbaa Manual touch test: Add color for Qt::MouseEventSynthesizedByApplication.
Fix a warning about a missing case statement.

Change-Id: Ic89646704d62668cf83c463dbf6e9b549a4b5200
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-04 09:50:50 +00:00
Jędrzej Nowacki
67509693bd Improve tst_qtimeline::setPaused resilience
The test should not depend on qWait explicitly

Change-Id: I13c01c47c9f7bae8b0c30afa2ac8550dc0fbf028
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-05-04 09:26:57 +00:00
Friedemann Kleint
22a7edd816 tst_QTcpSocket, tst_QUdpSocket: Improve diagnostics.
Add more error messages on failures.

Task-number: QTBUG-25367
Task-number: QTBUG-25368
Change-Id: I064143a058b7b98d9d5eecab8b5da49f5307e1eb
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-05-02 19:20:33 +00:00
Oswald Buddenhagen
be6a92ec09 remove redundant OTHER_FILES assignments
newer versions of qt creator understand QMAKE_EXTRA_COMPILERS and
INSTALLS, so there is no need to list the files twice.

Change-Id: Iccf3cc3248daf3422b8c366c2eb2d2f46c5f08d1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-02 18:34:47 +00:00
Liang Qi
4679861105 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-05-02 07:03:53 +00:00
Alex Trotsenko
a4d26cf522 QWindowsPipeWriter: ensure validity of the write buffer
QWindowsPipeWriter uses asynchronous API to perform writing. Once a cycle
has been started, the write buffer must remain valid until the write
operation is completed.

To avoid data corruption and possibly undefined behavior, this patch
makes QWindowsPipeWriter::write() take a QByteArray, which it keeps alive
for the duration of the write cycle.

Autotest-by: Thomas Hartmann
Task-number: QTBUG-52401
Change-Id: Ia35faee735c4e684267daa1f6bd689512b670cd2
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-30 13:13:26 +00:00
Konstantin Ritt
a954ba8315 Enable some tests previously disabled due to different results with HB-NG
As of 5.7, HB-NG is the default shaper engine.

Change-Id: Ia5400444a5e387fa6b56de47fabc6f1c2c166f85
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-29 16:25:46 +00:00
Liang Qi
b894a8def5 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/features/qml_module.prf
	mkspecs/features/qt_common.prf
	src/gui/text/qzip.cpp
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/windows/array.h
	src/testlib/qtestcase.cpp
	src/widgets/dialogs/qfilesystemmodel.h

Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
2016-04-29 17:55:20 +02:00
Allan Sandfeld Jensen
002112e805 Fix scroll regression near scroll-view ends
Fix regression in a7b0cb467c which caused
it to be hard to start scrolling at the ends of a scroll-view if using
fine grained scrolling events.

Change-Id: I55f3210150b993281545c3ad5a7356d892fa30b5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-29 10:25:45 +00:00
Friedemann Kleint
91f536dd71 tst_QMdiArea::subWindowActivated2(): Add activateWindow().
The widget is hidden, reshown and tested for active window, which
is flaky. Add a call to activateWindow() which increases
the chances of it becoming the active window should another window
appear.

Change-Id: Ibbecdbc43e2ac9638aec497c47fffaaffa1855af
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-29 08:58:15 +00:00
Thiago Macieira
ab2f768a8f Autotest: fix the QTimeZone::tzTest failure when database contains LMT
On some operating systems, tzdata files carry the Local Mean Time (LMT)
for the city in question, which better represents how time was tracked
before standard, hourly timezones were introduced in the early 20th
century. The test was asking for the data for 1653-02-09 and assumed
that it would find the first Central European Time (CET) rule, which
Germany didn't start using until 1893-04-01.

This fix allows us to remove the blacklist that had been applied to this
test without investigation. It wasn't related to OpenSUSE, aside from
the fact that OpenSUSE tzdata carries the LMT data.

Change-Id: Id5480807d25e49e78b79ffff1449bdaf46901367
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-04-29 08:23:11 +00:00
Kai Pastor
8c2b7405b4 QPdf: Force miter limit into valid range
Miter limits below 1.0 are not valid in PDF and trigger an error in the
Reader. This change enforces a minimum miter limit of 1.0, and it adds
a manual test for producing a PDF file demonstrating this issue.

Task-number: QTBUG-52641
Change-Id: I1c78b1c4a44579e95e1cddfb459926d304e60165
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-28 20:10:17 +00:00
Weng Xuetian
9be4ee5202 QtDBus: finish all pending call with error if disconnected
libdbus will send a local signal if connection gets disconnected. When
this happens, end all pending calls with QDBusError::Disconnected.

Task-number: QTBUG-51649
Change-Id: I5c7d2a468bb5da746d0c0e53e458c1e376f186a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-28 05:38:10 +00:00
Thiago Macieira
adac71c044 tst_compiler: Expand the attribute test
This is not exhaustive, but was enough to discover ICEs.

Change-Id: Ib60be1d298a66b72e3eb9b75ad538f0bf15b5f62
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Simo Fält <simo.falt@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-28 02:45:49 +00:00
Allan Sandfeld Jensen
e91abaa48e Optimize convert_Indexed8_to_X32
Basic optimization of conversion from indexed8.

Task-number: QTBUG-35747
Change-Id: Ic9d32789769eadb05fbecfebf2d2f2c87d66610b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-04-27 22:01:32 +00:00
Konstantin Ritt
3df159ba17 Improve the script itemization algorithm to match Unicode 8.0
Override preceding Common-s with a subsequent non-Inherited,
non-Common script.
This produces longer script runs, which automagically improves
the shaping quality (as we don't lose the context anymore),
the shaping performance (as we're typically shape a fewer runs),
and the fallback font selection (when the font supports more
than just a single language/script).

Task-number: QTBUG-29930
Change-Id: I1c55af30bd397871d7f1f6e062605517f5a7e5a1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-04-27 16:52:27 +00:00
Liang Qi
23a36fd2bf Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/io/qprocess_win.cpp
	src/widgets/itemviews/qheaderview.cpp

Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
2016-04-27 09:18:05 +02:00
Thiago Macieira
6e306e8d94 Disallow non-character Unicode codepoints in QUrl/QUrlQuery
Since they are non-characters and should not be used for text
interchange, it stands to reason that they should not appear in
unencoded for in a URL. To change the behavior, we just need to toggle
a simple flag for QUtf8Functions.

This behavior also matches the recommendation from RFC 3987. We do not
usually follow recommendations from that RFC (as it is generally
believed to be a bad RFC), but this one seems like a good idea.

Change-Id: Ifea6e497f11a461db432ffff1447486c623c12bd
Reviewed-by: David Faure <david.faure@kdab.com>
2016-04-26 23:08:11 +00:00
Friedemann Kleint
3a8f895d35 tst_QWidget/XCB: Use bottom/right corner of screen as safe cursor position.
Pushing the mouse rapidly to the top left corner causes KDE / KWin to
switch to "Present all Windows" (Ctrl+F9) mode, showing all windows.
This has been observed to be triggered programmatically by
QCursor::setPos(0, 0) if there is no other window beneath and apparently
depending on the perceived mouse "speed".
Suppress this by using the bottom right corner for XCB.

Change-Id: Id18d2f45a095ed4d4f365f010cf45a20b0d9435e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-04-26 13:12:16 +00:00
Shawn Rutledge
3d5e9a0ba1 Tablet device_information manual test: show wheel events received
We have a bug that proximity events are generating them spuriously;
this is a way of testing it.

Task-number: QTBUG-52921
Change-Id: I490dfcf8d5b325f612b733e29fd49de9418bb19e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-26 13:10:52 +00:00
Liang Qi
bb4b86618d Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	config.tests/unix/compile.test
	configure
	src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
	src/corelib/global/qglobal.cpp
	src/widgets/kernel/qapplication.cpp
	src/widgets/styles/qwindowsvistastyle.cpp
	tests/auto/corelib/kernel/qobject/tst_qobject.cpp

Change-Id: I067083f34e5290aa5f7565e40c30a069cc37b83a
2016-04-25 14:03:45 +02:00
David Faure
16fa29352b QMimeDatabase: fix mimeTypeForUrl for mailto URLs
The "path" of a mailto URL isn't a file, so we shouldn't try to do
glob-based matching. I was getting application/x-ms-dos-executable
for a .com domain and application/x-perl for a .pl domain...

Change-Id: Ifc346c3bba83ba1a8476db3202492f4c2e4d52bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-23 08:44:45 +00:00
Friedemann Kleint
84a49594d0 Windows/tst_QTcpServer: Suppress crash notification of crashingServer.
Suppress message dialog of the test helper as does QTestlib.

Task-number: QTBUG-52714
Change-Id: I5efd7d72f77c7689500ecaccf46f1f9dfb312140
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-23 06:09:44 +00:00
Alexander Volkov
e27fae353c QFileSystemModel: fix updating QFileInfo for a node after a file rename
Use the correct parent path for the renamed file when creating
QFileInfo. It must be a path to the parent directory, not to the
root directory of the model.

Modify tst_QFileSystemModel::setData() to test renames in subdirs
of the root directory of the model.

Change-Id: I69d9e3a937616857a81617791ed118af3f6eea05
Task-number: QTBUG-52561
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-22 09:49:53 +00:00
Friedemann Kleint
ccfe33dc67 QWidget::grab(): Use device pixel ratio.
Return pixmaps with device pixel ratio similar to QScreen::grabWindow(),
cf c0963486ce.
Adapt kernel tests accordingly.

Task-number: QTBUG-52137
Change-Id: I9ce276d5e2d87ae0d39c8639267d1ac283fed854
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-22 06:31:10 +00:00
Vyacheslav Grigoryev
072485048f QHeaderView: fixing selection of reordered rows and columns
The old code incorrectly calculated visual region for a selection (specified by
QItemSelection object) in case of reordered / swapped rows or columns. It used
the leftmost and rightmost (upmost and downmost for vertical mode) logical
indexes directly. However some middle logical index (in case of reorder) may be
the leftmost or rightmost visual index. In such cases the repainting didn't
work properly. This fix first checks whether reordering / swapping is in use.
If it isn't (ie visual=logical) we use code similar to the old code. Otherwise
the new code scans all selected logical indexes, translates them into visual
ones and gets the correct leftmost and rightmost indexes.

[ChangeLog][QtWidgets][QHeaderView] Fixed a repainting issue when items had been reordered.

Task-number: QTBUG-50171
Change-Id: If6afabebf445cf32a8e0afe262b6ee149e7c4b2b
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2016-04-21 21:13:38 +00:00
Friedemann Kleint
5386a35d35 Add a manual styles test.
Task-number: QTBUG-49374
Task-number: QTBUG-52622
Change-Id: Ic205590725780147aec3abc0f4be2058d001d358
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-04-20 11:35:48 +00:00
Eskil Abrahamsen Blomfeldt
7094466f7d Interpret fixed CSS line-height as minimum rather than absolute
The QTextBlockFormat::FixedHeight overrides the line height
regardless of its calculated height. If the line contains
objects or text which is higher than the specified line height,
using FixedHeight will cause them to overlap with the previous
line. This is not what happens in normal web browsers. The
expected behavior is that the line height given in CSS is the
minimum height, but that we still reserve space needed to display
everything without overlaps.

To make it possible for people to retain the old behavior, we
introduce the -qt-line-height-type property, which allows them
to override the default.

This also fixes output from toHtml() to use the new property
rather than set the minimum height of the paragraph or the
"line-spacing" property, which does not exist in either CSS nor
in Qt.

[ChangeLog][QtGui][Important Behavior Changes] When line height
is specified in pixels, this is now interpreted as the minimum
line height rather than an absolute line height to avoid overlaps.
To get the old behavior, use the -qt-line-height-type property in
CSS and set it to "fixed".

Task-number: QTBUG-51962
Change-Id: Ic2dde649b69209672170dad4c2de1e1c432a1078
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-19 09:32:10 +00:00
Oswald Buddenhagen
b3fcaea5f2 make extra compiler targets depend on their respective compiler
Change-Id: I6c04e0188137f6bbfeab243f00860b8ff079f69a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-18 09:38:10 +00:00
Friedemann Kleint
daebbcf5f4 Manual test qcursorhighdpi: Add drag and drop.
Add dragging functionality to the labels showing a pixmap
cursor, allowing for testing DnD with pixmaps with device pixel ratio.

Task-number: QTBUG-46068
Task-number: QTBUG-50938
Change-Id: If6781f380864e614efd4328e8b880b57cd900511
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-04-15 12:12:53 +00:00
Milla Pohjanheimo
dfe8a85e7c Blacklisting autotests that fail on RHEL 7.1 also on RHEL 7.2
Blacklisting those autotests that prevent us to get RHEL 7.2 in the CI.
The same tests have already been blacklisted for RHEL 7.1.

Change-Id: I2aa62647f7bd75681ea9e1d69bc62f9542fda5e2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
2016-04-15 05:57:02 +00:00
Thiago Macieira
77fb9ca271 Fix encoding of IDN hostnames with QUrl::host
When the formatting parameter wasn't exactly QUrl::EncodeUnicode, it
wouldn't encode, despite having to.

Change-Id: Id75834dab9ed466e94c7ffff1444bacc08dd109b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
2016-04-13 22:08:26 +00:00
Thiago Macieira
7ab0829823 Fix parsing of empty port sections in URLs
The RFC does allow it. It even has examples showing them as valid. In
section 6.2.3, it shows:

      http://example.com
      http://example.com/
      http://example.com:/
      http://example.com:80/

Change-Id: Id75834dab9ed466e94c7ffff1444b7195ad21cab
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-13 22:08:22 +00:00
Allan Sandfeld Jensen
f8efe8e0c9 Skip old benchmark that doesn't build automatically
This benchmark requires QtScript1 headers, and can not build as is.

Change-Id: I98e57ca2db82270a0887462d7959ff00e352166b
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-13 12:23:06 +00:00
Olivier Goffart
dbe9a8c969 Don't copy the functor object for each signal emission
The behavior was different in the variadic template code and in the C++98
code. The code without variadic template support was not copying the functor
object (e.g. a lambda) before calling it.
However, in the variadic template section, QtPrivate::FunctorCall::call
took the functor by value instead of by reference resulting in a copy.

QtPrivate::FunctorCall::call is a helper function for
QtPrivate::FunctionPointer::call which is only needed for variadic template
expension.

[ChangeLog][QtCore][QObject] If the compiler supports variadic templates,
no longer copy functor connected to a signal each time the signal is
emitted. Restoring the C++98 behavior.

Task-number: QTBUG-52542
Change-Id: I3ca20ef6910893b8a288e70af7de4c7b69502173
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-13 09:35:13 +00:00
Liang Qi
b94773c9c8 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	config.tests/unix/compile.test
	src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
	src/testlib/qtestcase.cpp
	src/testlib/qtestcase.qdoc

Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
2016-04-13 06:55:37 +02:00
Edward Welbourne
541c9d4d2a tst_QNetworkReply: Commentary fixes on test server workarounds.
Follow-up to commit 6fd205d5: document which version of danted shall
make one work-around redundant, document that another work-around is
still needed even with that v1.1.19; and remove a comment that
referred back to an XFAIL that commit 6fd205d5 removed.

Change-Id: I270b662528127c82184bff20b3cecea4f0c41b41
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-12 13:51:58 +00:00
Edward Welbourne
949aaffb4f tst_QNetworkReply: fix mis-guided use of QSKIP().
QSKIP() causes the whole test to be skipped, where this work-around
for a known quirk of the test server only requires skipping a single
Q_COMPARE(); the rest of the test passes fine without it.

Change-Id: Ie4612bd428f4cb4b342fad908cc2784fbadf069c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-12 13:25:30 +00:00
Jesus Fernandez
0f7171f290 Better error message when trying to load an invalid resource
Before this change QFile::errorString function was returning an
"Unknown error". Now it will return the typical ENOENT string.

Task-number: QTBUG-45259
Change-Id: Ib7634f1aa5d91f77151cf92c58d3956e20a4cc6b
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-12 10:18:57 +00:00
Joerg Bornemann
7b4c02d527 Fix finding a helper executable in tst_QLocalSocket
Use QFINDTESTDATA to find the socketprocess helper executable.
Now tst_QLocalSocket::processConnection() passes when started from Qt
Creator without adjusting the working directory.

Change-Id: I97ca3334a381b3cd646647487529bcd90b969528
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-11 10:47:26 +00:00
David Faure
b6eea89b67 Fix crash when using QLockFile in a global destructor
(for instance any global object which writes out to a config file in the
destructor). If the global cache isn't available anymore, don't use it.

Change-Id: I851a6e394d0b073aebf3ffd88b1966d424bfb92e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-10 07:37:51 +00:00
Thiago Macieira
8c427e5bdf Autotest: confirm that QHostAddress obeys RFC 5952 recommendations
Change-Id: I0c94a5c2846b48c8aea7ffff1435b8a7ccbd4d9e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
2016-04-09 05:16:40 +00:00
Alexander Grishkov
f39e542eb8 Fix parsing of IPv4 addresses with certain symbols
Add some extra checks to the parser to make sure that addresses
like "300-05" aren't interpreted as valid IPv4 addresses.

Change-Id: I12475eebc9452e060779bb05e2b4ad9512a28281
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-08 15:09:50 +00:00
Liang Qi
8e103902de tests: fix tst_QFontComboBox on OS X
After 909d3f5c7, private families will not be shown in user interface.

Task-number: QTBUG-41318
Change-Id: I15ae77cacd2a27c9db4b1a8ffbb582416258988c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-04-08 15:02:58 +00:00
Shawn Rutledge
3c08035b7b QScreen manual test: add MouseMonitor to test multi-screen scenarios
- QMouseEvent::screenPos() should be global desktop position
- QDesktopWidget::screenNumber() should tell the correct screen
- QGuiApplication::topLevelAt(screenPos) should find the window where
  the mouse is clicked

Change-Id: I9a63ab3ee1944b7246551d0f3d5e37f0d2aa5457
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-04-08 14:49:59 +00:00
Konstantin Ritt
eade27bb67 Update QDateTimeEdit tests to match data from CLDR v29
Change-Id: Ie4c4b2ed927caa95a9e7e11f94f05da2fe4e2860
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-08 03:51:23 +00:00
Konstantin Ritt
eb26f2b19b Re-generate QLocale data from CLDR v29
* A bunch of fixes and additions to the locale data
* Add new scripts from Unicode 8.0 and 9.0
* Map some potentially useful languages and territories

[ChangeLog][QtCore] QLocale data updated to CLDR v29

Change-Id: I759ccb27fe19be2722be913c5c2e6aa5f36e5c14
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-08 03:51:18 +00:00
Marc Mutz
6958e189a3 QStringRef: add missing {c,}r{begin,end}()
Most containers have them in Qt 5.7, so add them
to QStringRef, too.

Brush up the docs, use the const_iterator typedef
in the API, for consistency with QString's docs.

[ChangeLog][QtCore][QStringRef] Added reverse iterators,
rbegin(), rend(), crbegin(), crend().

Change-Id: I3d2884a1b2faae02c610ab3871552b65bc6e2521
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-07 11:29:45 +00:00
Liang Qi
ee0951d69b Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/network/access/qftp.cpp
	src/widgets/itemviews/qheaderview.cpp
	src/widgets/itemviews/qlistview.cpp
	tests/auto/network/access/qftp/tst_qftp.cpp

Change-Id: I9f928f25d45d8944dd60bb583f649fc1615bc5d9
2016-04-07 10:47:20 +02:00
Rolland Dudemaine
2b09d371eb Resolve build failure in network stress tests.
strncmp() needs 3 arguments, not 2.

Change-Id: Ia7077108a533321d5218cc35fd78ada8863f8200
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-07 07:22:54 +00:00
Marc Mutz
f72152381b tst_QStringBuilder: add a check for self-assignment
Change-Id: I78094146bf534163af12d6e265276d987d5ce994
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-07 07:02:38 +00:00
Friedemann Kleint
d37239aa41 QFtp: Use UTF-8 encoding.
According to RFC 2640, FTP uses UTF-8 encoding. Fix the conversions
accordingly.

Task-number: QTBUG-52303
Change-Id: I615199b3d074fc3861f25df113dda672525766b6
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-04-07 04:25:57 +00:00
Friedemann Kleint
2a282551ac Remove empty first lines of files.
They might upset licensing related tools.

Change-Id: I858d21fc418ba16959c88847b559b11bea29ed6b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-06 18:26:26 +00:00
Hannah von Reth
1726352207 Make sure QStyleOption is correctly initialized.
Ensures that QStyleOption is correctly initialized.
This prevents possible styling issues due to
QStyleOption's reporting version 0, see qstyleoption_cast.
This enables users to handle more cases in their QProxyStyle.
For now the test is only used for QCommonStyle.

Change-Id: I768db00b12b46890343fffe44e4f562762e9cf80
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-04-05 20:32:26 +00:00
Marc Mutz
284016c7e6 network-settings.h: don't crash when running without the test server
Don't access first() of a potentially-empty QList.
Check for QHostInfo::error() first.

Also change to constFirst() to prevent a detach.

Change-Id: I91fa0bbfb21f62af29abdb23b4869a7f039b259e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-05 06:52:39 +00:00
Liang Qi
216f57ef86 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
2016-04-04 08:59:18 +02:00
Stephen Kelly
bedf0367ac QVariant: Fix flags for type-erased associative iterator key
The flags here are passed to a private QVariant constructor, and they
really represent a boolean - IsPointer or not.

Because the flag for the key_type was incorrectly populated with the
flag for the value_type, memory would be corrupted when using a mapping
type whose value_type is a pointer, but whose key type was not, such as

  QMap<QString, int*>

This typo has been there since the concept was introduced in commit
v5.2.0-alpha1~807 (Add container access functionality for associative
containers in QVariant., 2013-04-05).

Task-number: QTBUG-52246
Change-Id: I9ecb13c603015eed2dc2ca43947fa0ecd6be8b5a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-03 10:58:12 +00:00
Kai Pastor
f805d7075a Fix QtGui dependencies in tests/benchmarks
Before this change, -no-gui builds failed already while running qmake.

Change-Id: I3e300a16669371098589822806c5cf8aa9b801c7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-01 20:24:04 +00:00
Marc Mutz
b7c7beacda QPointer: add a test for const QPointer<X>
People use this, so make sure there's a test for it.

I don't expect this test to fail, but static and
dynamic checkers should be presented with this
use-case, so they have a chance of warning, because
certain implementation strategies of QPointer may
make this code undefined.

Change-Id: I334bd73204ba4e186c4098fc6b7188917407e020
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-01 18:57:25 +00:00
Simo Fält
f44d826751 Autotest: Remove blacklistings
Removing blacklistings from tests that are now passing.

Change-Id: I00aa1ce286d3e7715fb4bee4a36d0d77049a29ae
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
2016-04-01 05:41:21 +00:00
Eirik Aavitsland
ea122fa9e3 Fixup for text labels in lancelot graphics test
Some strings were drawn with a different size or scaling than what the
string itself said, causing confusion.

Change-Id: I4b187cba6d467cfa0900576bdf451052baa806e6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-03-31 10:27:39 +00:00